Changeset 618 for trunk/src/binutils/bfd
- Timestamp:
- Aug 16, 2003, 11:33:53 PM (22 years ago)
- Location:
- trunk/src/binutils/bfd
- Files:
-
- 1 deleted
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/binutils/bfd/acinclude.m4
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r617 r618 124 124 AC_SUBST(INTLLIBS) 125 125 ]) 126 127 AC_DEFUN([AM_INSTALL_LIBBFD], 128 [AC_MSG_CHECKING([whether to install libbfd]) 129 AC_ARG_ENABLE(install-libbfd, 130 [ --enable-install-libbfd controls installation of libbfd and related headers], 131 install_libbfd_p=$enableval, 132 if test "${host}" = "${target}" || test "$enable_shared" = "yes"; then 133 install_libbfd_p=yes 134 else 135 install_libbfd_p=no 136 fi) 137 AC_MSG_RESULT($install_libbfd_p) 138 AM_CONDITIONAL(INSTALL_LIBBFD, test $install_libbfd_p = yes) 139 # libbfd.a is a host library containing target dependent code 140 bfdlibdir='$(libdir)' 141 bfdincludedir='$(includedir)' 142 if test "${host}" != "${target}"; then 143 bfdlibdir='$(exec_prefix)/$(host_alias)/$(target_alias)/lib' 144 bfdincludedir='$(exec_prefix)/$(host_alias)/$(target_alias)/include' 145 fi 146 AC_SUBST(bfdlibdir) 147 AC_SUBST(bfdincludedir) 148 ] 149 ) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/binutils/bfd/aclocal.m4
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r617 r618 137 137 ]) 138 138 139 AC_DEFUN([AM_INSTALL_LIBBFD], 140 [AC_MSG_CHECKING([whether to install libbfd]) 141 AC_ARG_ENABLE(install-libbfd, 142 [ --enable-install-libbfd controls installation of libbfd and related headers], 143 install_libbfd_p=$enableval, 144 if test "${host}" = "${target}" || test "$enable_shared" = "yes"; then 145 install_libbfd_p=yes 146 else 147 install_libbfd_p=no 148 fi) 149 AC_MSG_RESULT($install_libbfd_p) 150 AM_CONDITIONAL(INSTALL_LIBBFD, test $install_libbfd_p = yes) 151 # libbfd.a is a host library containing target dependent code 152 bfdlibdir='$(libdir)' 153 bfdincludedir='$(includedir)' 154 if test "${host}" != "${target}"; then 155 bfdlibdir='$(exec_prefix)/$(host_alias)/$(target_alias)/lib' 156 bfdincludedir='$(exec_prefix)/$(host_alias)/$(target_alias)/include' 157 fi 158 AC_SUBST(bfdlibdir) 159 AC_SUBST(bfdincludedir) 160 ] 161 ) 162 163 # Define a conditional. 164 165 AC_DEFUN([AM_CONDITIONAL], 166 [AC_SUBST($1_TRUE) 167 AC_SUBST($1_FALSE) 168 if $2; then 169 $1_TRUE= 170 $1_FALSE='#' 171 else 172 $1_TRUE='#' 173 $1_FALSE= 174 fi]) 175 176 #serial 1 177 # This test replaces the one in autoconf. 178 # Currently this macro should have the same name as the autoconf macro 179 # because gettext's gettext.m4 (distributed in the automake package) 180 # still uses it. Otherwise, the use in gettext.m4 makes autoheader 181 # give these diagnostics: 182 # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX 183 # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX 184 185 undefine([AC_ISC_POSIX]) 186 187 AC_DEFUN([AC_ISC_POSIX], 188 [ 189 dnl This test replaces the obsolescent AC_ISC_POSIX kludge. 190 AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"]) 191 ] 192 ) 193 139 194 # Do all the work for Automake. This macro actually does too much -- 140 195 # some checks are only needed if your package does certain things. … … 272 327 ) 273 328 274 # Define a conditional.275 276 AC_DEFUN([AM_CONDITIONAL],277 [AC_SUBST($1_TRUE)278 AC_SUBST($1_FALSE)279 if $2; then280 $1_TRUE=281 $1_FALSE='#'282 else283 $1_TRUE='#'284 $1_FALSE=285 fi])286 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/binutils/bfd/aoutx.h
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r617 r618 1 1 /* BFD semi-generic back-end for a.out binaries. 2 2 Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 3 2001 3 2001, 2002, 2003 4 4 Free Software Foundation, Inc. 5 5 Written by Cygnus Support. 6 6 7 This file is part of BFD, the Binary File Descriptor library.8 9 This program is free software; you can redistribute it and/or modify10 it under the terms of the GNU General Public License as published by11 the Free Software Foundation; either version 2 of the License, or12 (at your option) any later version.13 14 This program is distributed in the hope that it will be useful,15 but WITHOUT ANY WARRANTY; without even the implied warranty of16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the17 GNU General Public License for more details.18 19 You should have received a copy of the GNU General Public License20 along with this program; if not, write to the Free Software21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */7 This file is part of BFD, the Binary File Descriptor library. 8 9 This program is free software; you can redistribute it and/or modify 10 it under the terms of the GNU General Public License as published by 11 the Free Software Foundation; either version 2 of the License, or 12 (at your option) any later version. 13 14 This program is distributed in the hope that it will be useful, 15 but WITHOUT ANY WARRANTY; without even the implied warranty of 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 GNU General Public License for more details. 18 19 You should have received a copy of the GNU General Public License 20 along with this program; if not, write to the Free Software 21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 22 22 23 23 /* … … 106 106 to use the 107 107 @file{@var{XXX}.mt} file (by setting "<<bfd_target=XXX>>") when your 108 configuration is selected. 109 110 */ 108 configuration is selected. */ 111 109 112 110 /* Some assumptions: … … 121 119 #define KEEPIT udata.i 122 120 123 #include <ctype.h>124 121 #include "bfd.h" 125 122 #include "sysdep.h" 123 #include "safe-ctype.h" 126 124 #include "bfdlink.h" 127 125 … … 132 130 #include "aout/ar.h" 133 131 134 static boolean aout_get_external_symbols PARAMS ((bfd *)); 135 static boolean translate_from_native_sym_flags 132 static bfd_boolean aout_get_external_symbols 133 PARAMS ((bfd *)); 134 static bfd_boolean translate_from_native_sym_flags 136 135 PARAMS ((bfd *, aout_symbol_type *)); 137 static b oolean translate_to_native_sym_flags136 static bfd_boolean translate_to_native_sym_flags 138 137 PARAMS ((bfd *, asymbol *, struct external_nlist *)); 139 static void adjust_o_magic PARAMS ((bfd *, struct internal_exec *)); 140 static void adjust_z_magic PARAMS ((bfd *, struct internal_exec *)); 141 static void adjust_n_magic PARAMS ((bfd *, struct internal_exec *)); 138 static void adjust_o_magic 139 PARAMS ((bfd *, struct internal_exec *)); 140 static void adjust_z_magic 141 PARAMS ((bfd *, struct internal_exec *)); 142 static void adjust_n_magic 143 PARAMS ((bfd *, struct internal_exec *)); 144 reloc_howto_type * NAME(aout,reloc_type_lookup) 145 PARAMS ((bfd *, bfd_reloc_code_real_type)); 142 146 143 147 /* … … 152 156 address, a symbol index, and a type field. The extended records 153 157 (used on 29ks and sparcs) also have a full integer for an 154 addend. 155 156 */ 158 addend. */ 159 157 160 #ifndef CTOR_TABLE_RELOC_HOWTO 158 161 #define CTOR_TABLE_RELOC_IDX 2 159 #define CTOR_TABLE_RELOC_HOWTO(BFD) ((obj_reloc_entry_size(BFD) == RELOC_EXT_SIZE \ 160 ? howto_table_ext : howto_table_std) \ 161 + CTOR_TABLE_RELOC_IDX) 162 #define CTOR_TABLE_RELOC_HOWTO(BFD) \ 163 ((obj_reloc_entry_size (BFD) == RELOC_EXT_SIZE \ 164 ? howto_table_ext : howto_table_std) \ 165 + CTOR_TABLE_RELOC_IDX) 162 166 #endif 163 167 … … 191 195 reloc_howto_type howto_table_ext[] = 192 196 { 193 /* type rs size bsz pcrel bitpos ovrf sf name part_inpl readmask setmask pcdone */194 HOWTO(RELOC_8, 0, 0, 8, false, 0, complain_overflow_bitfield,0,"8", false, 0,0x000000ff, false),195 HOWTO(RELOC_16, 0, 1, 16, false, 0, complain_overflow_bitfield,0,"16", false, 0,0x0000ffff, false),196 HOWTO(RELOC_32, 0, 2, 32, false, 0, complain_overflow_bitfield,0,"32", false, 0,0xffffffff, false),197 HOWTO(RELOC_DISP8, 0, 0, 8, true, 0, complain_overflow_signed,0,"DISP8", false, 0,0x000000ff, false),198 HOWTO(RELOC_DISP16, 0, 1, 16, true, 0, complain_overflow_signed,0,"DISP16", false, 0,0x0000ffff, false),199 HOWTO(RELOC_DISP32, 0, 2, 32, true, 0, complain_overflow_signed,0,"DISP32", false, 0,0xffffffff, false),200 HOWTO(RELOC_WDISP30,2, 2, 30, true, 0, complain_overflow_signed,0,"WDISP30", false, 0,0x3fffffff, false),201 HOWTO(RELOC_WDISP22,2, 2, 22, true, 0, complain_overflow_signed,0,"WDISP22", false, 0,0x003fffff, false),202 HOWTO(RELOC_HI22, 10, 2, 22, false, 0, complain_overflow_bitfield,0,"HI22", false, 0,0x003fffff, false),203 HOWTO(RELOC_22, 0, 2, 22, false, 0, complain_overflow_bitfield,0,"22", false, 0,0x003fffff, false),204 HOWTO(RELOC_13, 0, 2, 13, false, 0, complain_overflow_bitfield,0,"13", false, 0,0x00001fff, false),205 HOWTO(RELOC_LO10, 0, 2, 10, false, 0, complain_overflow_dont,0,"LO10", false, 0,0x000003ff, false),206 HOWTO(RELOC_SFA_BASE,0, 2, 32, false, 0, complain_overflow_bitfield,0,"SFA_BASE", false, 0,0xffffffff, false),207 HOWTO(RELOC_SFA_OFF13,0,2, 32, false, 0, complain_overflow_bitfield,0,"SFA_OFF13",false, 0,0xffffffff, false),208 HOWTO(RELOC_BASE10, 0, 2, 10, false, 0, complain_overflow_dont,0,"BASE10", false, 0,0x000003ff, false),209 HOWTO(RELOC_BASE13, 0, 2, 13, false, 0, complain_overflow_signed,0,"BASE13", false, 0,0x00001fff, false),210 HOWTO(RELOC_BASE22, 10, 2, 22, false, 0, complain_overflow_bitfield,0,"BASE22", false, 0,0x003fffff, false),211 HOWTO(RELOC_PC10, 0, 2, 10, true, 0, complain_overflow_dont,0,"PC10", false, 0,0x000003ff, true),212 HOWTO(RELOC_PC22, 10, 2, 22, true, 0, complain_overflow_signed,0,"PC22", false, 0,0x003fffff, true),213 HOWTO(RELOC_JMP_TBL,2, 2, 30, true, 0, complain_overflow_signed,0,"JMP_TBL", false, 0,0x3fffffff, false),214 HOWTO(RELOC_SEGOFF16,0, 2, 0, false, 0, complain_overflow_bitfield,0,"SEGOFF16", false, 0,0x00000000, false),215 HOWTO(RELOC_GLOB_DAT,0, 2, 0, false, 0, complain_overflow_bitfield,0,"GLOB_DAT", false, 0,0x00000000, false),216 HOWTO(RELOC_JMP_SLOT,0, 2, 0, false, 0, complain_overflow_bitfield,0,"JMP_SLOT", false, 0,0x00000000, false),217 HOWTO(RELOC_RELATIVE,0, 2, 0, false, 0, complain_overflow_bitfield,0,"RELATIVE", false, 0,0x00000000, false),218 HOWTO(0, 0, 0, 0, false, 0, complain_overflow_dont, 0, "R_SPARC_NONE", false,0,0x00000000,true),219 HOWTO(0, 0, 0, 0, false, 0, complain_overflow_dont, 0, "R_SPARC_NONE", false,0,0x00000000,true),197 /* type rs size bsz pcrel bitpos ovrf sf name part_inpl readmask setmask pcdone. */ 198 HOWTO(RELOC_8, 0, 0, 8, FALSE, 0, complain_overflow_bitfield,0,"8", FALSE, 0,0x000000ff, FALSE), 199 HOWTO(RELOC_16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield,0,"16", FALSE, 0,0x0000ffff, FALSE), 200 HOWTO(RELOC_32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,0,"32", FALSE, 0,0xffffffff, FALSE), 201 HOWTO(RELOC_DISP8, 0, 0, 8, TRUE, 0, complain_overflow_signed,0,"DISP8", FALSE, 0,0x000000ff, FALSE), 202 HOWTO(RELOC_DISP16, 0, 1, 16, TRUE, 0, complain_overflow_signed,0,"DISP16", FALSE, 0,0x0000ffff, FALSE), 203 HOWTO(RELOC_DISP32, 0, 2, 32, TRUE, 0, complain_overflow_signed,0,"DISP32", FALSE, 0,0xffffffff, FALSE), 204 HOWTO(RELOC_WDISP30,2, 2, 30, TRUE, 0, complain_overflow_signed,0,"WDISP30", FALSE, 0,0x3fffffff, FALSE), 205 HOWTO(RELOC_WDISP22,2, 2, 22, TRUE, 0, complain_overflow_signed,0,"WDISP22", FALSE, 0,0x003fffff, FALSE), 206 HOWTO(RELOC_HI22, 10, 2, 22, FALSE, 0, complain_overflow_bitfield,0,"HI22", FALSE, 0,0x003fffff, FALSE), 207 HOWTO(RELOC_22, 0, 2, 22, FALSE, 0, complain_overflow_bitfield,0,"22", FALSE, 0,0x003fffff, FALSE), 208 HOWTO(RELOC_13, 0, 2, 13, FALSE, 0, complain_overflow_bitfield,0,"13", FALSE, 0,0x00001fff, FALSE), 209 HOWTO(RELOC_LO10, 0, 2, 10, FALSE, 0, complain_overflow_dont,0,"LO10", FALSE, 0,0x000003ff, FALSE), 210 HOWTO(RELOC_SFA_BASE,0, 2, 32, FALSE, 0, complain_overflow_bitfield,0,"SFA_BASE", FALSE, 0,0xffffffff, FALSE), 211 HOWTO(RELOC_SFA_OFF13,0,2, 32, FALSE, 0, complain_overflow_bitfield,0,"SFA_OFF13",FALSE, 0,0xffffffff, FALSE), 212 HOWTO(RELOC_BASE10, 0, 2, 10, FALSE, 0, complain_overflow_dont,0,"BASE10", FALSE, 0,0x000003ff, FALSE), 213 HOWTO(RELOC_BASE13, 0, 2, 13, FALSE, 0, complain_overflow_signed,0,"BASE13", FALSE, 0,0x00001fff, FALSE), 214 HOWTO(RELOC_BASE22, 10, 2, 22, FALSE, 0, complain_overflow_bitfield,0,"BASE22", FALSE, 0,0x003fffff, FALSE), 215 HOWTO(RELOC_PC10, 0, 2, 10, TRUE, 0, complain_overflow_dont,0,"PC10", FALSE, 0,0x000003ff, TRUE), 216 HOWTO(RELOC_PC22, 10, 2, 22, TRUE, 0, complain_overflow_signed,0,"PC22", FALSE, 0,0x003fffff, TRUE), 217 HOWTO(RELOC_JMP_TBL,2, 2, 30, TRUE, 0, complain_overflow_signed,0,"JMP_TBL", FALSE, 0,0x3fffffff, FALSE), 218 HOWTO(RELOC_SEGOFF16,0, 2, 0, FALSE, 0, complain_overflow_bitfield,0,"SEGOFF16", FALSE, 0,0x00000000, FALSE), 219 HOWTO(RELOC_GLOB_DAT,0, 2, 0, FALSE, 0, complain_overflow_bitfield,0,"GLOB_DAT", FALSE, 0,0x00000000, FALSE), 220 HOWTO(RELOC_JMP_SLOT,0, 2, 0, FALSE, 0, complain_overflow_bitfield,0,"JMP_SLOT", FALSE, 0,0x00000000, FALSE), 221 HOWTO(RELOC_RELATIVE,0, 2, 0, FALSE, 0, complain_overflow_bitfield,0,"RELATIVE", FALSE, 0,0x00000000, FALSE), 222 HOWTO(0, 0, 0, 0, FALSE, 0, complain_overflow_dont, 0, "R_SPARC_NONE", FALSE,0,0x00000000,TRUE), 223 HOWTO(0, 0, 0, 0, FALSE, 0, complain_overflow_dont, 0, "R_SPARC_NONE", FALSE,0,0x00000000,TRUE), 220 224 #define RELOC_SPARC_REV32 RELOC_WDISP19 221 HOWTO(RELOC_SPARC_REV32, 0, 2, 32, false, 0, complain_overflow_dont,0,"R_SPARC_REV32", false, 0,0xffffffff, false),225 HOWTO(RELOC_SPARC_REV32, 0, 2, 32, FALSE, 0, complain_overflow_dont,0,"R_SPARC_REV32", FALSE, 0,0xffffffff, FALSE), 222 226 }; 223 227 224 228 /* Convert standard reloc records to "arelent" format (incl byte swap). */ 225 229 226 reloc_howto_type howto_table_std[] = { 227 /* type rs size bsz pcrel bitpos ovrf sf name part_inpl readmask setmask pcdone */ 228 HOWTO( 0, 0, 0, 8, false, 0, complain_overflow_bitfield,0,"8", true, 0x000000ff,0x000000ff, false), 229 HOWTO( 1, 0, 1, 16, false, 0, complain_overflow_bitfield,0,"16", true, 0x0000ffff,0x0000ffff, false), 230 HOWTO( 2, 0, 2, 32, false, 0, complain_overflow_bitfield,0,"32", true, 0xffffffff,0xffffffff, false), 231 HOWTO( 3, 0, 4, 64, false, 0, complain_overflow_bitfield,0,"64", true, 0xdeaddead,0xdeaddead, false), 232 HOWTO( 4, 0, 0, 8, true, 0, complain_overflow_signed, 0,"DISP8", true, 0x000000ff,0x000000ff, false), 233 HOWTO( 5, 0, 1, 16, true, 0, complain_overflow_signed, 0,"DISP16", true, 0x0000ffff,0x0000ffff, false), 234 HOWTO( 6, 0, 2, 32, true, 0, complain_overflow_signed, 0,"DISP32", true, 0xffffffff,0xffffffff, false), 235 HOWTO( 7, 0, 4, 64, true, 0, complain_overflow_signed, 0,"DISP64", true, 0xfeedface,0xfeedface, false), 236 HOWTO( 8, 0, 2, 0, false, 0, complain_overflow_bitfield,0,"GOT_REL", false, 0,0x00000000, false), 237 HOWTO( 9, 0, 1, 16, false, 0, complain_overflow_bitfield,0,"BASE16", false,0xffffffff,0xffffffff, false), 238 HOWTO(10, 0, 2, 32, false, 0, complain_overflow_bitfield,0,"BASE32", false,0xffffffff,0xffffffff, false), 230 reloc_howto_type howto_table_std[] = 231 { 232 /* type rs size bsz pcrel bitpos ovrf sf name part_inpl readmask setmask pcdone. */ 233 HOWTO ( 0, 0, 0, 8, FALSE, 0, complain_overflow_bitfield,0,"8", TRUE, 0x000000ff,0x000000ff, FALSE), 234 HOWTO ( 1, 0, 1, 16, FALSE, 0, complain_overflow_bitfield,0,"16", TRUE, 0x0000ffff,0x0000ffff, FALSE), 235 HOWTO ( 2, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,0,"32", TRUE, 0xffffffff,0xffffffff, FALSE), 236 HOWTO ( 3, 0, 4, 64, FALSE, 0, complain_overflow_bitfield,0,"64", TRUE, 0xdeaddead,0xdeaddead, FALSE), 237 HOWTO ( 4, 0, 0, 8, TRUE, 0, complain_overflow_signed, 0,"DISP8", TRUE, 0x000000ff,0x000000ff, FALSE), 238 HOWTO ( 5, 0, 1, 16, TRUE, 0, complain_overflow_signed, 0,"DISP16", TRUE, 0x0000ffff,0x0000ffff, FALSE), 239 HOWTO ( 6, 0, 2, 32, TRUE, 0, complain_overflow_signed, 0,"DISP32", TRUE, 0xffffffff,0xffffffff, FALSE), 240 HOWTO ( 7, 0, 4, 64, TRUE, 0, complain_overflow_signed, 0,"DISP64", TRUE, 0xfeedface,0xfeedface, FALSE), 241 HOWTO ( 8, 0, 2, 0, FALSE, 0, complain_overflow_bitfield,0,"GOT_REL", FALSE, 0,0x00000000, FALSE), 242 HOWTO ( 9, 0, 1, 16, FALSE, 0, complain_overflow_bitfield,0,"BASE16", FALSE,0xffffffff,0xffffffff, FALSE), 243 HOWTO (10, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,0,"BASE32", FALSE,0xffffffff,0xffffffff, FALSE), 239 244 EMPTY_HOWTO (-1), 240 245 EMPTY_HOWTO (-1), … … 242 247 EMPTY_HOWTO (-1), 243 248 EMPTY_HOWTO (-1), 244 HOWTO (16, 0, 2, 0, false, 0, complain_overflow_bitfield,0,"JMP_TABLE", false, 0,0x00000000, false),249 HOWTO (16, 0, 2, 0, FALSE, 0, complain_overflow_bitfield,0,"JMP_TABLE", FALSE, 0,0x00000000, FALSE), 245 250 EMPTY_HOWTO (-1), 246 251 EMPTY_HOWTO (-1), … … 258 263 EMPTY_HOWTO (-1), 259 264 EMPTY_HOWTO (-1), 260 HOWTO (32, 0, 2, 0, false, 0, complain_overflow_bitfield,0,"RELATIVE", false, 0,0x00000000, false),265 HOWTO (32, 0, 2, 0, FALSE, 0, complain_overflow_bitfield,0,"RELATIVE", FALSE, 0,0x00000000, FALSE), 261 266 EMPTY_HOWTO (-1), 262 267 EMPTY_HOWTO (-1), … … 266 271 EMPTY_HOWTO (-1), 267 272 EMPTY_HOWTO (-1), 268 HOWTO (40, 0, 2, 0, false, 0, complain_overflow_bitfield,0,"BASEREL", false, 0,0x00000000, false),273 HOWTO (40, 0, 2, 0, FALSE, 0, complain_overflow_bitfield,0,"BASEREL", FALSE, 0,0x00000000, FALSE), 269 274 }; 270 275 271 #define TABLE_SIZE(TABLE) (sizeof (TABLE) /sizeof (TABLE[0]))276 #define TABLE_SIZE(TABLE) (sizeof (TABLE) / sizeof (TABLE[0])) 272 277 273 278 #ifndef IS_STAB … … 280 285 bfd_reloc_code_real_type code; 281 286 { 282 #define EXT(i, j) case i: return &howto_table_ext[j]283 #define STD(i, j) case i: return &howto_table_std[j]287 #define EXT(i, j) case i: return &howto_table_ext[j] 288 #define STD(i, j) case i: return &howto_table_std[j] 284 289 int ext = obj_reloc_entry_size (abfd) == RELOC_EXT_SIZE; 290 285 291 if (code == BFD_RELOC_CTOR) 286 292 switch (bfd_get_arch_info (abfd)->bits_per_address) … … 293 299 break; 294 300 } 301 295 302 if (ext) 296 303 switch (code) … … 315 322 } 316 323 else 317 /* std relocs */324 /* std relocs. */ 318 325 switch (code) 319 326 { 327 STD (BFD_RELOC_8, 0); 320 328 STD (BFD_RELOC_16, 1); 321 329 STD (BFD_RELOC_32, 2); … … 371 379 memset ((PTR) execp, 0, sizeof (struct internal_exec)); 372 380 /* Now fill in fields in the execp, from the bytes in the raw data. */ 373 execp->a_info = bfd_h_get_32 (abfd, bytes->e_info);381 execp->a_info = H_GET_32 (abfd, bytes->e_info); 374 382 execp->a_text = GET_WORD (abfd, bytes->e_text); 375 383 execp->a_data = GET_WORD (abfd, bytes->e_data); … … 406 414 407 415 /* Now fill in fields in the raw data, from the fields in the exec struct. */ 408 bfd_h_put_32 (abfd, execp->a_info , bytes->e_info);416 H_PUT_32 (abfd, execp->a_info , bytes->e_info); 409 417 PUT_WORD (abfd, execp->a_text , bytes->e_text); 410 418 PUT_WORD (abfd, execp->a_data , bytes->e_data); … … 418 426 /* Make all the section for an a.out file. */ 419 427 420 b oolean428 bfd_boolean 421 429 NAME(aout,make_sections) (abfd) 422 430 bfd *abfd; … … 424 432 if (obj_textsec (abfd) == (asection *) NULL 425 433 && bfd_make_section (abfd, ".text") == (asection *) NULL) 426 return false;434 return FALSE; 427 435 if (obj_datasec (abfd) == (asection *) NULL 428 436 && bfd_make_section (abfd, ".data") == (asection *) NULL) 429 return false;437 return FALSE; 430 438 if (obj_bsssec (abfd) == (asection *) NULL 431 439 && bfd_make_section (abfd, ".bss") == (asection *) NULL) 432 return false;433 return true;440 return FALSE; 441 return TRUE; 434 442 } 435 443 … … 459 467 struct aout_data_struct *rawptr, *oldrawptr; 460 468 const bfd_target *result; 461 462 rawptr = (struct aout_data_struct *) bfd_zalloc (abfd, sizeof (struct aout_data_struct )); 469 bfd_size_type amt = sizeof (struct aout_data_struct); 470 471 rawptr = (struct aout_data_struct *) bfd_zalloc (abfd, amt); 463 472 if (rawptr == NULL) 464 473 return 0; … … 475 484 476 485 abfd->tdata.aout_data->a.hdr = &rawptr->e; 477 *(abfd->tdata.aout_data->a.hdr) = *execp; /* Copy in the internal_exec struct */ 486 /* Copy in the internal_exec struct. */ 487 *(abfd->tdata.aout_data->a.hdr) = *execp; 478 488 execp = abfd->tdata.aout_data->a.hdr; 479 489 480 /* Set the file flags */490 /* Set the file flags. */ 481 491 abfd->flags = BFD_NO_FLAGS; 482 492 if (execp->a_drsize || execp->a_trsize) 483 493 abfd->flags |= HAS_RELOC; 484 /* Setting of EXEC_P has been deferred to the bottom of this function */494 /* Setting of EXEC_P has been deferred to the bottom of this function. */ 485 495 if (execp->a_syms) 486 496 abfd->flags |= HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS; 487 if (N_DYNAMIC (*execp))497 if (N_DYNAMIC (*execp)) 488 498 abfd->flags |= DYNAMIC; 489 499 … … 534 544 535 545 if (! NAME(aout,make_sections) (abfd)) 536 return NULL;546 goto error_ret; 537 547 538 548 obj_datasec (abfd)->_raw_size = execp->a_data; … … 562 572 struct exec *execp = exec_hdr (abfd); 563 573 564 obj_textsec (abfd)->size = N_TXTSIZE (*execp);565 obj_textsec (abfd)->raw_size = N_TXTSIZE (*execp);566 /* data and bss are already filled in since they're so standard*/567 568 /* The virtual memory addresses of the sections */569 obj_textsec (abfd)->vma = N_TXTADDR (*execp);570 obj_datasec (abfd)->vma = N_DATADDR (*execp);571 obj_bsssec (abfd)->vma = N_BSSADDR (*execp);572 573 /* The file offsets of the sections */574 obj_textsec (abfd)->filepos = N_TXTOFF (*execp);575 obj_datasec (abfd)->filepos = N_DATOFF (*execp);576 577 /* The file offsets of the relocation info */578 obj_textsec (abfd)->rel_filepos = N_TRELOFF (*execp);579 obj_datasec (abfd)->rel_filepos = N_DRELOFF (*execp);574 obj_textsec (abfd)->size = N_TXTSIZE (*execp); 575 obj_textsec (abfd)->raw_size = N_TXTSIZE (*execp); 576 /* Data and bss are already filled in since they're so standard. */ 577 578 /* The virtual memory addresses of the sections. */ 579 obj_textsec (abfd)->vma = N_TXTADDR (*execp); 580 obj_datasec (abfd)->vma = N_DATADDR (*execp); 581 obj_bsssec (abfd)->vma = N_BSSADDR (*execp); 582 583 /* The file offsets of the sections. */ 584 obj_textsec (abfd)->filepos = N_TXTOFF (*execp); 585 obj_datasec (abfd)->filepos = N_DATOFF (*execp); 586 587 /* The file offsets of the relocation info. */ 588 obj_textsec (abfd)->rel_filepos = N_TRELOFF (*execp); 589 obj_datasec (abfd)->rel_filepos = N_DRELOFF (*execp); 580 590 581 591 /* The file offsets of the string table and symbol table. */ … … 584 594 585 595 /* Determine the architecture and machine type of the object file. */ 586 switch (N_MACHTYPE (*exec_hdr (abfd))) { 587 default: 588 abfd->obj_arch = bfd_arch_obscure; 589 break; 590 } 591 592 adata(abfd)->page_size = TARGET_PAGE_SIZE; 593 adata(abfd)->segment_size = SEGMENT_SIZE; 594 adata(abfd)->exec_bytes_size = EXEC_BYTES_SIZE; 596 switch (N_MACHTYPE (*exec_hdr (abfd))) 597 { 598 default: 599 abfd->obj_arch = bfd_arch_obscure; 600 break; 601 } 602 603 adata (abfd)->page_size = TARGET_PAGE_SIZE; 604 adata (abfd)->segment_size = SEGMENT_SIZE; 605 adata (abfd)->exec_bytes_size = EXEC_BYTES_SIZE; 595 606 596 607 return abfd->xvec; … … 624 635 625 636 if (execp->a_entry != 0 626 || (execp->a_entry >= obj_textsec(abfd)->vma 627 && execp->a_entry < obj_textsec(abfd)->vma + obj_textsec(abfd)->_raw_size)) 637 || (execp->a_entry >= obj_textsec (abfd)->vma 638 && execp->a_entry < (obj_textsec (abfd)->vma 639 + obj_textsec (abfd)->_raw_size))) 628 640 abfd->flags |= EXEC_P; 629 641 #ifdef STAT_FOR_EXEC … … 641 653 if (abfd->iostream != NULL 642 654 && (abfd->flags & BFD_IN_MEMORY) == 0 643 && (fstat (fileno((FILE *) (abfd->iostream)), &stat_buf) == 0)655 && (fstat (fileno ((FILE *) (abfd->iostream)), &stat_buf) == 0) 644 656 && ((stat_buf.st_mode & 0111) != 0)) 645 657 abfd->flags |= EXEC_P; … … 654 666 obj_datasec (abfd)->next = obj_bsssec (abfd); 655 667 #endif 656 }657 else658 { 659 free (rawptr);660 abfd->tdata.aout_data = oldrawptr;661 }662 return result;668 return result; 669 } 670 671 error_ret: 672 bfd_release (abfd, rawptr); 673 abfd->tdata.aout_data = oldrawptr; 674 return NULL; 663 675 } 664 676 … … 668 680 669 681 SYNOPSIS 670 b oolean aout_@var{size}_mkobject, (bfd *abfd);682 bfd_boolean aout_@var{size}_mkobject, (bfd *abfd); 671 683 672 684 DESCRIPTION … … 674 686 */ 675 687 676 b oolean688 bfd_boolean 677 689 NAME(aout,mkobject) (abfd) 678 690 bfd *abfd; 679 691 { 680 struct aout_data_struct *rawptr; 692 struct aout_data_struct *rawptr; 693 bfd_size_type amt = sizeof (struct aout_data_struct); 681 694 682 695 bfd_set_error (bfd_error_system_call); 683 696 684 /* Use an intermediate variable for clarity */ 685 rawptr = (struct aout_data_struct *)bfd_zalloc (abfd, sizeof (struct aout_data_struct )); 686 697 rawptr = (struct aout_data_struct *) bfd_zalloc (abfd, amt); 687 698 if (rawptr == NULL) 688 return false;699 return FALSE; 689 700 690 701 abfd->tdata.aout_data = rawptr; 691 702 exec_hdr (abfd) = &(rawptr->e); 692 703 693 obj_textsec (abfd) = (asection *) NULL;694 obj_datasec (abfd) = (asection *) NULL;695 obj_bsssec (abfd) = (asection *) NULL;696 697 return true;704 obj_textsec (abfd) = (asection *) NULL; 705 obj_datasec (abfd) = (asection *) NULL; 706 obj_bsssec (abfd) = (asection *) NULL; 707 708 return TRUE; 698 709 } 699 710 … … 721 732 enum bfd_architecture arch; 722 733 unsigned long machine; 723 b oolean *unknown;734 bfd_boolean *unknown; 724 735 { 725 736 enum machine_type arch_flags; 726 737 727 738 arch_flags = M_UNKNOWN; 728 *unknown = true; 729 730 switch (arch) { 731 case bfd_arch_sparc: 732 if (machine == 0 733 || machine == bfd_mach_sparc 734 || machine == bfd_mach_sparc_sparclite 735 || machine == bfd_mach_sparc_sparclite_le 736 || machine == bfd_mach_sparc_v9) 737 arch_flags = M_SPARC; 738 else if (machine == bfd_mach_sparc_sparclet) 739 arch_flags = M_SPARCLET; 740 break; 741 742 case bfd_arch_m68k: 743 switch (machine) { 744 case 0: arch_flags = M_68010; break; 745 case bfd_mach_m68000: arch_flags = M_UNKNOWN; *unknown = false; break; 746 case bfd_mach_m68010: arch_flags = M_68010; break; 747 case bfd_mach_m68020: arch_flags = M_68020; break; 748 default: arch_flags = M_UNKNOWN; break; 749 } 750 break; 751 752 case bfd_arch_i386: 753 if (machine == 0) arch_flags = M_386; 754 break; 755 756 case bfd_arch_a29k: 757 if (machine == 0) arch_flags = M_29K; 758 break; 759 760 case bfd_arch_arm: 761 if (machine == 0) arch_flags = M_ARM; 762 break; 763 764 case bfd_arch_mips: 765 switch (machine) { 766 case 0: 767 case bfd_mach_mips3000: 768 case bfd_mach_mips3900: 769 arch_flags = M_MIPS1; 739 *unknown = TRUE; 740 741 switch (arch) 742 { 743 case bfd_arch_sparc: 744 if (machine == 0 745 || machine == bfd_mach_sparc 746 || machine == bfd_mach_sparc_sparclite 747 || machine == bfd_mach_sparc_sparclite_le 748 || machine == bfd_mach_sparc_v9) 749 arch_flags = M_SPARC; 750 else if (machine == bfd_mach_sparc_sparclet) 751 arch_flags = M_SPARCLET; 770 752 break; 771 case bfd_mach_mips6000: 772 arch_flags = M_MIPS2; 753 754 case bfd_arch_m68k: 755 switch (machine) 756 { 757 case 0: arch_flags = M_68010; break; 758 case bfd_mach_m68000: arch_flags = M_UNKNOWN; *unknown = FALSE; break; 759 case bfd_mach_m68010: arch_flags = M_68010; break; 760 case bfd_mach_m68020: arch_flags = M_68020; break; 761 default: arch_flags = M_UNKNOWN; break; 762 } 773 763 break; 774 case bfd_mach_mips4000: 775 case bfd_mach_mips4010: 776 case bfd_mach_mips4100: 777 case bfd_mach_mips4300: 778 case bfd_mach_mips4400: 779 case bfd_mach_mips4600: 780 case bfd_mach_mips4650: 781 case bfd_mach_mips8000: 782 case bfd_mach_mips10000: 783 case bfd_mach_mips12000: 784 case bfd_mach_mips16: 785 case bfd_mach_mips32: 786 case bfd_mach_mips32_4k: 787 case bfd_mach_mips5: 788 case bfd_mach_mips64: 789 case bfd_mach_mips_sb1: 790 /* FIXME: These should be MIPS3, MIPS4, MIPS16, MIPS32, etc. */ 791 arch_flags = M_MIPS2; 764 765 case bfd_arch_i386: 766 if (machine == 0 767 || machine == bfd_mach_i386_i386 768 || machine == bfd_mach_i386_i386_intel_syntax) 769 arch_flags = M_386; 792 770 break; 771 772 case bfd_arch_a29k: 773 if (machine == 0) 774 arch_flags = M_29K; 775 break; 776 777 case bfd_arch_arm: 778 if (machine == 0) 779 arch_flags = M_ARM; 780 break; 781 782 case bfd_arch_mips: 783 switch (machine) 784 { 785 case 0: 786 case bfd_mach_mips3000: 787 case bfd_mach_mips3900: 788 arch_flags = M_MIPS1; 789 break; 790 case bfd_mach_mips6000: 791 arch_flags = M_MIPS2; 792 break; 793 case bfd_mach_mips4000: 794 case bfd_mach_mips4010: 795 case bfd_mach_mips4100: 796 case bfd_mach_mips4300: 797 case bfd_mach_mips4400: 798 case bfd_mach_mips4600: 799 case bfd_mach_mips4650: 800 case bfd_mach_mips8000: 801 case bfd_mach_mips10000: 802 case bfd_mach_mips12000: 803 case bfd_mach_mips16: 804 case bfd_mach_mipsisa32: 805 case bfd_mach_mipsisa32r2: 806 case bfd_mach_mips5: 807 case bfd_mach_mipsisa64: 808 case bfd_mach_mips_sb1: 809 /* FIXME: These should be MIPS3, MIPS4, MIPS16, MIPS32, etc. */ 810 arch_flags = M_MIPS2; 811 break; 812 default: 813 arch_flags = M_UNKNOWN; 814 break; 815 } 816 break; 817 818 case bfd_arch_ns32k: 819 switch (machine) 820 { 821 case 0: arch_flags = M_NS32532; break; 822 case 32032: arch_flags = M_NS32032; break; 823 case 32532: arch_flags = M_NS32532; break; 824 default: arch_flags = M_UNKNOWN; break; 825 } 826 break; 827 828 case bfd_arch_vax: 829 *unknown = FALSE; 830 break; 831 832 case bfd_arch_cris: 833 if (machine == 0 || machine == 255) 834 arch_flags = M_CRIS; 835 break; 836 793 837 default: 794 838 arch_flags = M_UNKNOWN; 795 break; 796 } 797 break; 798 799 case bfd_arch_ns32k: 800 switch (machine) { 801 case 0: arch_flags = M_NS32532; break; 802 case 32032: arch_flags = M_NS32032; break; 803 case 32532: arch_flags = M_NS32532; break; 804 default: arch_flags = M_UNKNOWN; break; 805 } 806 break; 807 808 case bfd_arch_vax: 809 *unknown = false; 810 break; 811 812 case bfd_arch_cris: 813 if (machine == 0 || machine == 255) arch_flags = M_CRIS; 814 break; 815 816 default: 817 arch_flags = M_UNKNOWN; 818 } 839 } 819 840 820 841 if (arch_flags != M_UNKNOWN) 821 *unknown = false;842 *unknown = FALSE; 822 843 823 844 return arch_flags; … … 829 850 830 851 SYNOPSIS 831 b oolean aout_@var{size}_set_arch_mach,852 bfd_boolean aout_@var{size}_set_arch_mach, 832 853 (bfd *, 833 854 enum bfd_architecture arch, … … 840 861 */ 841 862 842 b oolean863 bfd_boolean 843 864 NAME(aout,set_arch_mach) (abfd, arch, machine) 844 865 bfd *abfd; … … 847 868 { 848 869 if (! bfd_default_set_arch_mach (abfd, arch, machine)) 849 return false;870 return FALSE; 850 871 851 872 if (arch != bfd_arch_unknown) 852 873 { 853 b oolean unknown;874 bfd_boolean unknown; 854 875 855 876 NAME(aout,machine_type) (arch, machine, &unknown); 856 877 if (unknown) 857 return false; 858 } 859 860 /* Determine the size of a relocation entry */ 861 switch (arch) { 862 case bfd_arch_sparc: 863 case bfd_arch_a29k: 864 case bfd_arch_mips: 865 obj_reloc_entry_size (abfd) = RELOC_EXT_SIZE; 866 break; 867 default: 868 obj_reloc_entry_size (abfd) = RELOC_STD_SIZE; 869 break; 870 } 871 872 return (*aout_backend_info(abfd)->set_sizes) (abfd); 878 return FALSE; 879 } 880 881 /* Determine the size of a relocation entry. */ 882 switch (arch) 883 { 884 case bfd_arch_sparc: 885 case bfd_arch_a29k: 886 case bfd_arch_mips: 887 obj_reloc_entry_size (abfd) = RELOC_EXT_SIZE; 888 break; 889 default: 890 obj_reloc_entry_size (abfd) = RELOC_STD_SIZE; 891 break; 892 } 893 894 return (*aout_backend_info (abfd)->set_sizes) (abfd); 873 895 } 874 896 … … 883 905 884 906 /* Text. */ 885 obj_textsec (abfd)->filepos = pos;886 if (!obj_textsec (abfd)->user_set_vma)887 obj_textsec (abfd)->vma = vma;907 obj_textsec (abfd)->filepos = pos; 908 if (!obj_textsec (abfd)->user_set_vma) 909 obj_textsec (abfd)->vma = vma; 888 910 else 889 vma = obj_textsec (abfd)->vma;890 891 pos += obj_textsec (abfd)->_raw_size;892 vma += obj_textsec (abfd)->_raw_size;911 vma = obj_textsec (abfd)->vma; 912 913 pos += obj_textsec (abfd)->_raw_size; 914 vma += obj_textsec (abfd)->_raw_size; 893 915 894 916 /* Data. */ 895 if (!obj_datasec (abfd)->user_set_vma)896 { 897 #if 0 /* ?? Does alignment in the file image really matter? */898 pad = align_power (vma, obj_datasec (abfd)->alignment_power) - vma;917 if (!obj_datasec (abfd)->user_set_vma) 918 { 919 #if 0 /* ?? Does alignment in the file image really matter? */ 920 pad = align_power (vma, obj_datasec (abfd)->alignment_power) - vma; 899 921 #endif 900 obj_textsec (abfd)->_raw_size += pad;922 obj_textsec (abfd)->_raw_size += pad; 901 923 pos += pad; 902 924 vma += pad; 903 obj_datasec (abfd)->vma = vma;925 obj_datasec (abfd)->vma = vma; 904 926 } 905 927 else 906 vma = obj_datasec (abfd)->vma;907 obj_datasec (abfd)->filepos = pos;908 pos += obj_datasec (abfd)->_raw_size;909 vma += obj_datasec (abfd)->_raw_size;928 vma = obj_datasec (abfd)->vma; 929 obj_datasec (abfd)->filepos = pos; 930 pos += obj_datasec (abfd)->_raw_size; 931 vma += obj_datasec (abfd)->_raw_size; 910 932 911 933 /* BSS. */ 912 if (!obj_bsssec (abfd)->user_set_vma)934 if (!obj_bsssec (abfd)->user_set_vma) 913 935 { 914 936 #if 0 915 pad = align_power (vma, obj_bsssec (abfd)->alignment_power) - vma;937 pad = align_power (vma, obj_bsssec (abfd)->alignment_power) - vma; 916 938 #endif 917 obj_datasec (abfd)->_raw_size += pad;939 obj_datasec (abfd)->_raw_size += pad; 918 940 pos += pad; 919 941 vma += pad; 920 obj_bsssec (abfd)->vma = vma;942 obj_bsssec (abfd)->vma = vma; 921 943 } 922 944 else 923 945 { 924 /* The VMA of the .bss section is set by the theVMA of the946 /* The VMA of the .bss section is set by the VMA of the 925 947 .data section plus the size of the .data section. We may 926 948 need to add padding bytes to make this true. */ … … 932 954 } 933 955 } 934 obj_bsssec (abfd)->filepos = pos;956 obj_bsssec (abfd)->filepos = pos; 935 957 936 958 /* Fix up the exec header. */ 937 execp->a_text = obj_textsec (abfd)->_raw_size;938 execp->a_data = obj_datasec (abfd)->_raw_size;939 execp->a_bss = obj_bsssec (abfd)->_raw_size;959 execp->a_text = obj_textsec (abfd)->_raw_size; 960 execp->a_data = obj_datasec (abfd)->_raw_size; 961 execp->a_bss = obj_bsssec (abfd)->_raw_size; 940 962 N_SET_MAGIC (*execp, OMAGIC); 941 963 } … … 948 970 bfd_size_type data_pad, text_pad; 949 971 file_ptr text_end; 950 CONSTstruct aout_backend_data *abdp;972 const struct aout_backend_data *abdp; 951 973 int ztih; /* Nonzero if text includes exec header. */ 952 974 … … 957 979 && (abdp->text_includes_header 958 980 || obj_aout_subformat (abfd) == q_magic_format)); 959 obj_textsec (abfd)->filepos = (ztih960 ? adata(abfd).exec_bytes_size961 : adata(abfd).zmagic_disk_block_size);962 if (! obj_textsec (abfd)->user_set_vma)981 obj_textsec (abfd)->filepos = (ztih 982 ? adata (abfd).exec_bytes_size 983 : adata (abfd).zmagic_disk_block_size); 984 if (! obj_textsec (abfd)->user_set_vma) 963 985 { 964 986 /* ?? Do we really need to check for relocs here? */ 965 obj_textsec (abfd)->vma = ((abfd->flags & HAS_RELOC)966 ? 0967 : (ztih968 ? (abdp->default_text_vma969 + adata(abfd).exec_bytes_size)970 : abdp->default_text_vma));987 obj_textsec (abfd)->vma = ((abfd->flags & HAS_RELOC) 988 ? 0 989 : (ztih 990 ? (abdp->default_text_vma 991 + adata (abfd).exec_bytes_size) 992 : abdp->default_text_vma)); 971 993 text_pad = 0; 972 994 } … … 999 1021 text_end += obj_textsec (abfd)->filepos; 1000 1022 } 1001 obj_textsec (abfd)->_raw_size += text_pad;1023 obj_textsec (abfd)->_raw_size += text_pad; 1002 1024 text_end += text_pad; 1003 1025 1004 1026 /* Data. */ 1005 if (!obj_datasec (abfd)->user_set_vma)1027 if (!obj_datasec (abfd)->user_set_vma) 1006 1028 { 1007 1029 bfd_vma vma; 1008 vma = obj_textsec (abfd)->vma + obj_textsec(abfd)->_raw_size;1009 obj_datasec (abfd)->vma = BFD_ALIGN (vma, adata(abfd).segment_size);1030 vma = obj_textsec (abfd)->vma + obj_textsec (abfd)->_raw_size; 1031 obj_datasec (abfd)->vma = BFD_ALIGN (vma, adata (abfd).segment_size); 1010 1032 } 1011 1033 if (abdp && abdp->zmagic_mapped_contiguous) 1012 1034 { 1013 text_pad = (obj_datasec(abfd)->vma 1014 - obj_textsec(abfd)->vma 1015 - obj_textsec(abfd)->_raw_size); 1016 obj_textsec(abfd)->_raw_size += text_pad; 1017 } 1018 obj_datasec(abfd)->filepos = (obj_textsec(abfd)->filepos 1019 + obj_textsec(abfd)->_raw_size); 1035 asection * text = obj_textsec (abfd); 1036 asection * data = obj_datasec (abfd); 1037 1038 text_pad = data->vma - (text->vma + text->_raw_size); 1039 /* Only pad the text section if the data 1040 section is going to be placed after it. */ 1041 if (text_pad > 0) 1042 text->_raw_size += text_pad; 1043 } 1044 obj_datasec (abfd)->filepos = (obj_textsec (abfd)->filepos 1045 + obj_textsec (abfd)->_raw_size); 1020 1046 1021 1047 /* Fix up exec header while we're at it. */ 1022 execp->a_text = obj_textsec (abfd)->_raw_size;1048 execp->a_text = obj_textsec (abfd)->_raw_size; 1023 1049 if (ztih && (!abdp || (abdp && !abdp->exec_header_not_counted))) 1024 execp->a_text += adata (abfd).exec_bytes_size;1050 execp->a_text += adata (abfd).exec_bytes_size; 1025 1051 if (obj_aout_subformat (abfd) == q_magic_format) 1026 1052 N_SET_MAGIC (*execp, QMAGIC); … … 1029 1055 1030 1056 /* Spec says data section should be rounded up to page boundary. */ 1031 obj_datasec (abfd)->_raw_size1032 = align_power (obj_datasec (abfd)->_raw_size,1033 obj_bsssec (abfd)->alignment_power);1034 execp->a_data = BFD_ALIGN (obj_datasec (abfd)->_raw_size,1035 adata (abfd).page_size);1036 data_pad = execp->a_data - obj_datasec (abfd)->_raw_size;1057 obj_datasec (abfd)->_raw_size 1058 = align_power (obj_datasec (abfd)->_raw_size, 1059 obj_bsssec (abfd)->alignment_power); 1060 execp->a_data = BFD_ALIGN (obj_datasec (abfd)->_raw_size, 1061 adata (abfd).page_size); 1062 data_pad = execp->a_data - obj_datasec (abfd)->_raw_size; 1037 1063 1038 1064 /* BSS. */ 1039 if (!obj_bsssec (abfd)->user_set_vma)1040 obj_bsssec (abfd)->vma = (obj_datasec(abfd)->vma1041 + obj_datasec(abfd)->_raw_size);1065 if (!obj_bsssec (abfd)->user_set_vma) 1066 obj_bsssec (abfd)->vma = (obj_datasec (abfd)->vma 1067 + obj_datasec (abfd)->_raw_size); 1042 1068 /* If the BSS immediately follows the data section and extra space 1043 1069 in the page is left after the data section, fudge data … … 1047 1073 could have explicitly set the BSS vma to immediately follow 1048 1074 the data section.) */ 1049 if (align_power (obj_bsssec (abfd)->vma, obj_bsssec(abfd)->alignment_power)1050 == obj_datasec (abfd)->vma + obj_datasec(abfd)->_raw_size)1051 execp->a_bss = (data_pad > obj_bsssec (abfd)->_raw_size) ? 0 :1052 obj_bsssec(abfd)->_raw_size - data_pad;1075 if (align_power (obj_bsssec (abfd)->vma, obj_bsssec (abfd)->alignment_power) 1076 == obj_datasec (abfd)->vma + obj_datasec (abfd)->_raw_size) 1077 execp->a_bss = (data_pad > obj_bsssec (abfd)->_raw_size 1078 ? 0 : obj_bsssec (abfd)->_raw_size - data_pad); 1053 1079 else 1054 execp->a_bss = obj_bsssec (abfd)->_raw_size;1080 execp->a_bss = obj_bsssec (abfd)->_raw_size; 1055 1081 } 1056 1082 … … 1060 1086 struct internal_exec *execp; 1061 1087 { 1062 file_ptr pos = adata (abfd).exec_bytes_size;1088 file_ptr pos = adata (abfd).exec_bytes_size; 1063 1089 bfd_vma vma = 0; 1064 1090 int pad; 1065 1091 1066 1092 /* Text. */ 1067 obj_textsec (abfd)->filepos = pos;1068 if (!obj_textsec (abfd)->user_set_vma)1069 obj_textsec (abfd)->vma = vma;1093 obj_textsec (abfd)->filepos = pos; 1094 if (!obj_textsec (abfd)->user_set_vma) 1095 obj_textsec (abfd)->vma = vma; 1070 1096 else 1071 vma = obj_textsec (abfd)->vma;1072 pos += obj_textsec (abfd)->_raw_size;1073 vma += obj_textsec (abfd)->_raw_size;1097 vma = obj_textsec (abfd)->vma; 1098 pos += obj_textsec (abfd)->_raw_size; 1099 vma += obj_textsec (abfd)->_raw_size; 1074 1100 1075 1101 /* Data. */ 1076 obj_datasec (abfd)->filepos = pos;1077 if (!obj_datasec (abfd)->user_set_vma)1078 obj_datasec (abfd)->vma = BFD_ALIGN (vma, adata(abfd).segment_size);1079 vma = obj_datasec (abfd)->vma;1102 obj_datasec (abfd)->filepos = pos; 1103 if (!obj_datasec (abfd)->user_set_vma) 1104 obj_datasec (abfd)->vma = BFD_ALIGN (vma, adata (abfd).segment_size); 1105 vma = obj_datasec (abfd)->vma; 1080 1106 1081 1107 /* Since BSS follows data immediately, see if it needs alignment. */ 1082 vma += obj_datasec (abfd)->_raw_size;1083 pad = align_power (vma, obj_bsssec (abfd)->alignment_power) - vma;1084 obj_datasec (abfd)->_raw_size += pad;1085 pos += obj_datasec (abfd)->_raw_size;1108 vma += obj_datasec (abfd)->_raw_size; 1109 pad = align_power (vma, obj_bsssec (abfd)->alignment_power) - vma; 1110 obj_datasec (abfd)->_raw_size += pad; 1111 pos += obj_datasec (abfd)->_raw_size; 1086 1112 1087 1113 /* BSS. */ 1088 if (!obj_bsssec (abfd)->user_set_vma)1089 obj_bsssec (abfd)->vma = vma;1114 if (!obj_bsssec (abfd)->user_set_vma) 1115 obj_bsssec (abfd)->vma = vma; 1090 1116 else 1091 vma = obj_bsssec (abfd)->vma;1117 vma = obj_bsssec (abfd)->vma; 1092 1118 1093 1119 /* Fix up exec header. */ 1094 execp->a_text = obj_textsec (abfd)->_raw_size;1095 execp->a_data = obj_datasec (abfd)->_raw_size;1096 execp->a_bss = obj_bsssec (abfd)->_raw_size;1120 execp->a_text = obj_textsec (abfd)->_raw_size; 1121 execp->a_data = obj_datasec (abfd)->_raw_size; 1122 execp->a_bss = obj_bsssec (abfd)->_raw_size; 1097 1123 N_SET_MAGIC (*execp, NMAGIC); 1098 1124 } 1099 1125 1100 b oolean1126 bfd_boolean 1101 1127 NAME(aout,adjust_sizes_and_vmas) (abfd, text_size, text_end) 1102 1128 bfd *abfd; … … 1107 1133 1108 1134 if (! NAME(aout,make_sections) (abfd)) 1109 return false;1110 1111 if (adata (abfd).magic != undecided_magic)1112 return true;1113 1114 obj_textsec (abfd)->_raw_size =1115 align_power (obj_textsec(abfd)->_raw_size,1116 obj_textsec(abfd)->alignment_power);1135 return FALSE; 1136 1137 if (adata (abfd).magic != undecided_magic) 1138 return TRUE; 1139 1140 obj_textsec (abfd)->_raw_size = 1141 align_power (obj_textsec (abfd)->_raw_size, 1142 obj_textsec (abfd)->alignment_power); 1117 1143 1118 1144 *text_size = obj_textsec (abfd)->_raw_size; … … 1135 1161 if (abfd->flags & D_PAGED) 1136 1162 /* Whether or not WP_TEXT is set -- let D_PAGED override. */ 1137 adata (abfd).magic = z_magic;1163 adata (abfd).magic = z_magic; 1138 1164 else if (abfd->flags & WP_TEXT) 1139 adata (abfd).magic = n_magic;1165 adata (abfd).magic = n_magic; 1140 1166 else 1141 adata (abfd).magic = o_magic;1167 adata (abfd).magic = o_magic; 1142 1168 1143 1169 #ifdef BFD_AOUT_DEBUG /* requires gcc2 */ … … 1145 1171 fprintf (stderr, "%s text=<%x,%x,%x> data=<%x,%x,%x> bss=<%x,%x,%x>\n", 1146 1172 ({ char *str; 1147 switch (adata(abfd).magic) { 1148 case n_magic: str = "NMAGIC"; break; 1149 case o_magic: str = "OMAGIC"; break; 1150 case z_magic: str = "ZMAGIC"; break; 1151 default: abort (); 1152 } 1173 switch (adata (abfd).magic) 1174 { 1175 case n_magic: str = "NMAGIC"; break; 1176 case o_magic: str = "OMAGIC"; break; 1177 case z_magic: str = "ZMAGIC"; break; 1178 default: abort (); 1179 } 1153 1180 str; 1154 1181 }), 1155 obj_textsec (abfd)->vma, obj_textsec(abfd)->_raw_size,1156 obj_textsec (abfd)->alignment_power,1157 obj_datasec (abfd)->vma, obj_datasec(abfd)->_raw_size,1158 obj_datasec (abfd)->alignment_power,1159 obj_bsssec (abfd)->vma, obj_bsssec(abfd)->_raw_size,1160 obj_bsssec (abfd)->alignment_power);1182 obj_textsec (abfd)->vma, obj_textsec (abfd)->_raw_size, 1183 obj_textsec (abfd)->alignment_power, 1184 obj_datasec (abfd)->vma, obj_datasec (abfd)->_raw_size, 1185 obj_datasec (abfd)->alignment_power, 1186 obj_bsssec (abfd)->vma, obj_bsssec (abfd)->_raw_size, 1187 obj_bsssec (abfd)->alignment_power); 1161 1188 #endif 1162 1189 #endif 1163 1190 1164 switch (adata (abfd).magic)1191 switch (adata (abfd).magic) 1165 1192 { 1166 1193 case o_magic: … … 1179 1206 #ifdef BFD_AOUT_DEBUG 1180 1207 fprintf (stderr, " text=<%x,%x,%x> data=<%x,%x,%x> bss=<%x,%x>\n", 1181 obj_textsec (abfd)->vma, obj_textsec(abfd)->_raw_size,1182 obj_textsec (abfd)->filepos,1183 obj_datasec (abfd)->vma, obj_datasec(abfd)->_raw_size,1184 obj_datasec (abfd)->filepos,1185 obj_bsssec (abfd)->vma, obj_bsssec(abfd)->_raw_size);1208 obj_textsec (abfd)->vma, obj_textsec (abfd)->_raw_size, 1209 obj_textsec (abfd)->filepos, 1210 obj_datasec (abfd)->vma, obj_datasec (abfd)->_raw_size, 1211 obj_datasec (abfd)->filepos, 1212 obj_bsssec (abfd)->vma, obj_bsssec (abfd)->_raw_size); 1186 1213 #endif 1187 1214 1188 return true;1215 return TRUE; 1189 1216 } 1190 1217 … … 1194 1221 1195 1222 SYNOPSIS 1196 b oolean aout_@var{size}_new_section_hook,1223 bfd_boolean aout_@var{size}_new_section_hook, 1197 1224 (bfd *abfd, 1198 1225 asection *newsect)); … … 1202 1229 request. 1203 1230 */ 1204 b oolean1231 bfd_boolean 1205 1232 NAME(aout,new_section_hook) (abfd, newsect) 1206 1233 bfd *abfd; 1207 1234 asection *newsect; 1208 1235 { 1209 /* align to double at least*/1210 newsect->alignment_power = bfd_get_arch_info (abfd)->section_align_power;1236 /* Align to double at least. */ 1237 newsect->alignment_power = bfd_get_arch_info (abfd)->section_align_power; 1211 1238 1212 1239 if (bfd_get_format (abfd) == bfd_object) 1213 { 1214 if (obj_textsec(abfd) == NULL && !strcmp(newsect->name, ".text")) { 1215 obj_textsec(abfd)= newsect; 1216 newsect->target_index = N_TEXT; 1217 return true; 1218 } 1219 1220 if (obj_datasec(abfd) == NULL && !strcmp(newsect->name, ".data")) { 1221 obj_datasec(abfd) = newsect; 1222 newsect->target_index = N_DATA; 1223 return true; 1224 } 1225 1226 if (obj_bsssec(abfd) == NULL && !strcmp(newsect->name, ".bss")) { 1227 obj_bsssec(abfd) = newsect; 1228 newsect->target_index = N_BSS; 1229 return true; 1230 } 1231 1232 } 1233 1234 /* We allow more than three sections internally */ 1235 return true; 1236 } 1237 1238 boolean 1240 { 1241 if (obj_textsec (abfd) == NULL && !strcmp (newsect->name, ".text")) 1242 { 1243 obj_textsec (abfd)= newsect; 1244 newsect->target_index = N_TEXT; 1245 return TRUE; 1246 } 1247 1248 if (obj_datasec (abfd) == NULL && !strcmp (newsect->name, ".data")) 1249 { 1250 obj_datasec (abfd) = newsect; 1251 newsect->target_index = N_DATA; 1252 return TRUE; 1253 } 1254 1255 if (obj_bsssec (abfd) == NULL && !strcmp (newsect->name, ".bss")) 1256 { 1257 obj_bsssec (abfd) = newsect; 1258 newsect->target_index = N_BSS; 1259 return TRUE; 1260 } 1261 } 1262 1263 /* We allow more than three sections internally. */ 1264 return TRUE; 1265 } 1266 1267 bfd_boolean 1239 1268 NAME(aout,set_section_contents) (abfd, section, location, offset, count) 1240 1269 bfd *abfd; … … 1250 1279 { 1251 1280 if (! NAME(aout,adjust_sizes_and_vmas) (abfd, &text_size, &text_end)) 1252 return false;1281 return FALSE; 1253 1282 } 1254 1283 … … 1256 1285 { 1257 1286 bfd_set_error (bfd_error_no_contents); 1258 return false;1287 return FALSE; 1259 1288 } 1260 1289 … … 1262 1291 && section != obj_datasec (abfd)) 1263 1292 { 1264 (*_bfd_error_handler) 1265 (_("%s: can not represent section `%s' in a.out object file format"), 1266 bfd_get_filename (abfd), bfd_get_section_name (abfd, section)); 1267 bfd_set_error (bfd_error_nonrepresentable_section); 1268 return false; 1293 if (aout_section_merge_with_text_p (abfd, section)) 1294 section->filepos = obj_textsec (abfd)->filepos + 1295 (section->vma - obj_textsec (abfd)->vma); 1296 else 1297 { 1298 (*_bfd_error_handler) 1299 (_("%s: can not represent section `%s' in a.out object file format"), 1300 bfd_get_filename (abfd), bfd_get_section_name (abfd, section)); 1301 bfd_set_error (bfd_error_nonrepresentable_section); 1302 return FALSE; 1303 } 1269 1304 } 1270 1305 … … 1272 1307 { 1273 1308 if (bfd_seek (abfd, section->filepos + offset, SEEK_SET) != 0 1274 || bfd_ write (location, 1, count, abfd) != count)1275 return false;1276 } 1277 1278 return true;1309 || bfd_bwrite (location, count, abfd) != count) 1310 return FALSE; 1311 } 1312 1313 return TRUE; 1279 1314 } 1280 1315 … … 1282 1317 /* Read the external symbols from an a.out file. */ 1283 1318 1284 static b oolean1319 static bfd_boolean 1285 1320 aout_get_external_symbols (abfd) 1286 1321 bfd *abfd; … … 1290 1325 bfd_size_type count; 1291 1326 struct external_nlist *syms; 1327 bfd_size_type amt; 1292 1328 1293 1329 count = exec_hdr (abfd)->a_syms / EXTERNAL_NLIST_SIZE; 1294 1330 1295 1331 #ifdef USE_MMAP 1296 if ( bfd_get_file_window (abfd,1297 obj_sym_filepos (abfd),exec_hdr (abfd)->a_syms,1298 &obj_aout_sym_window (abfd), true) == false)1299 return false;1332 if (! bfd_get_file_window (abfd, obj_sym_filepos (abfd), 1333 exec_hdr (abfd)->a_syms, 1334 &obj_aout_sym_window (abfd), TRUE)) 1335 return FALSE; 1300 1336 syms = (struct external_nlist *) obj_aout_sym_window (abfd).data; 1301 1337 #else … … 1304 1340 possible to free them. */ 1305 1341 syms = ((struct external_nlist *) 1306 bfd_malloc ( (size_t)count * EXTERNAL_NLIST_SIZE));1342 bfd_malloc (count * EXTERNAL_NLIST_SIZE)); 1307 1343 if (syms == (struct external_nlist *) NULL && count != 0) 1308 return false; 1309 1344 return FALSE; 1345 1346 amt = exec_hdr (abfd)->a_syms; 1310 1347 if (bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET) != 0 1311 || (bfd_read (syms, 1, exec_hdr (abfd)->a_syms, abfd) 1312 != exec_hdr (abfd)->a_syms)) 1348 || bfd_bread (syms, amt, abfd) != amt) 1313 1349 { 1314 1350 free (syms); 1315 return false;1351 return FALSE; 1316 1352 } 1317 1353 #endif … … 1327 1363 bfd_size_type stringsize; 1328 1364 char *strings; 1365 bfd_size_type amt = BYTES_IN_WORD; 1329 1366 1330 1367 /* Get the size of the strings. */ 1331 1368 if (bfd_seek (abfd, obj_str_filepos (abfd), SEEK_SET) != 0 1332 || (bfd_read ((PTR) string_chars, BYTES_IN_WORD, 1, abfd) 1333 != BYTES_IN_WORD)) 1334 return false; 1369 || bfd_bread ((PTR) string_chars, amt, abfd) != amt) 1370 return FALSE; 1335 1371 stringsize = GET_WORD (abfd, string_chars); 1336 1372 1337 1373 #ifdef USE_MMAP 1338 if ( bfd_get_file_window (abfd, obj_str_filepos (abfd), stringsize,1339 &obj_aout_string_window (abfd), true) == false)1340 return false;1374 if (! bfd_get_file_window (abfd, obj_str_filepos (abfd), stringsize, 1375 &obj_aout_string_window (abfd), TRUE)) 1376 return FALSE; 1341 1377 strings = (char *) obj_aout_string_window (abfd).data; 1342 1378 #else 1343 strings = (char *) bfd_malloc ( (size_t)stringsize + 1);1379 strings = (char *) bfd_malloc (stringsize + 1); 1344 1380 if (strings == NULL) 1345 return false;1381 return FALSE; 1346 1382 1347 1383 /* Skip space for the string count in the buffer for convenience 1348 1384 when using indexes. */ 1349 if (bfd_read (strings + BYTES_IN_WORD, 1, stringsize - BYTES_IN_WORD, 1350 abfd) 1351 != stringsize - BYTES_IN_WORD) 1385 amt = stringsize - BYTES_IN_WORD; 1386 if (bfd_bread (strings + BYTES_IN_WORD, amt, abfd) != amt) 1352 1387 { 1353 1388 free (strings); 1354 return false;1389 return FALSE; 1355 1390 } 1356 1391 #endif … … 1365 1400 } 1366 1401 1367 return true;1402 return TRUE; 1368 1403 } 1369 1404 … … 1373 1408 symbol->flags and symbol->section, and adjusting symbol->value. */ 1374 1409 1375 static b oolean1410 static bfd_boolean 1376 1411 translate_from_native_sym_flags (abfd, cache_ptr) 1377 1412 bfd *abfd; … … 1386 1421 1387 1422 /* This is a debugging symbol. */ 1388 1389 1423 cache_ptr->symbol.flags = BSF_DEBUGGING; 1390 1424 … … 1411 1445 cache_ptr->symbol.value -= sec->vma; 1412 1446 1413 return true;1447 return TRUE; 1414 1448 } 1415 1449 … … 1480 1514 arelent_chain *reloc; 1481 1515 asection *into_section; 1516 bfd_size_type amt; 1482 1517 1483 1518 /* This is a set symbol. The name of the symbol is the name … … 1496 1531 char *copy; 1497 1532 1498 copy = bfd_alloc (abfd, strlen (cache_ptr->symbol.name) + 1); 1533 amt = strlen (cache_ptr->symbol.name) + 1; 1534 copy = bfd_alloc (abfd, amt); 1499 1535 if (copy == NULL) 1500 return false;1536 return FALSE; 1501 1537 1502 1538 strcpy (copy, cache_ptr->symbol.name); 1503 1539 section = bfd_make_section (abfd, copy); 1504 1540 if (section == NULL) 1505 return false;1541 return FALSE; 1506 1542 } 1507 1543 1508 reloc = (arelent_chain *) bfd_alloc (abfd, sizeof (arelent_chain)); 1544 amt = sizeof (arelent_chain); 1545 reloc = (arelent_chain *) bfd_alloc (abfd, amt); 1509 1546 if (reloc == NULL) 1510 return false;1547 return FALSE; 1511 1548 1512 1549 /* Build a relocation entry for the constructor. */ … … 1551 1588 section->_raw_size += BYTES_IN_WORD; 1552 1589 1553 reloc->relent.howto = CTOR_TABLE_RELOC_HOWTO (abfd);1590 reloc->relent.howto = CTOR_TABLE_RELOC_HOWTO (abfd); 1554 1591 1555 1592 #endif /* 0 */ … … 1633 1670 } 1634 1671 1635 return true;1672 return TRUE; 1636 1673 } 1637 1674 1638 1675 /* Set the fields of SYM_POINTER according to CACHE_PTR. */ 1639 1676 1640 static b oolean1677 static bfd_boolean 1641 1678 translate_to_native_sym_flags (abfd, cache_ptr, sym_pointer) 1642 1679 bfd *abfd; … … 1664 1701 cache_ptr->name != NULL ? cache_ptr->name : _("*unknown*")); 1665 1702 bfd_set_error (bfd_error_nonrepresentable_section); 1666 return false;1703 return FALSE; 1667 1704 } 1668 1705 … … 1689 1726 else 1690 1727 { 1691 (*_bfd_error_handler) 1692 (_("%s: can not represent section `%s' in a.out object file format"), 1693 bfd_get_filename (abfd), bfd_get_section_name (abfd, sec)); 1694 bfd_set_error (bfd_error_nonrepresentable_section); 1695 return false; 1696 } 1697 1698 /* Turn the symbol from section relative to absolute again */ 1728 if (aout_section_merge_with_text_p (abfd, sec)) 1729 sym_pointer->e_type[0] |= N_TEXT; 1730 else 1731 { 1732 (*_bfd_error_handler) 1733 (_("%s: can not represent section `%s' in a.out object file format"), 1734 bfd_get_filename (abfd), bfd_get_section_name (abfd, sec)); 1735 bfd_set_error (bfd_error_nonrepresentable_section); 1736 return FALSE; 1737 } 1738 } 1739 1740 /* Turn the symbol from section relative to absolute again. */ 1699 1741 value += sec->vma + off; 1700 1742 … … 1712 1754 { 1713 1755 int type = ((aout_symbol_type *) cache_ptr)->type; 1756 1714 1757 switch (type) 1715 1758 { … … 1738 1781 } 1739 1782 1740 PUT_WORD (abfd, value, sym_pointer->e_value);1741 1742 return true;1783 PUT_WORD (abfd, value, sym_pointer->e_value); 1784 1785 return TRUE; 1743 1786 } 1744 1787 … … 1750 1793 bfd *abfd; 1751 1794 { 1752 aout_symbol_type *new =1753 (aout_symbol_type *)bfd_zalloc (abfd, sizeof (aout_symbol_type));1795 bfd_size_type amt = sizeof (aout_symbol_type); 1796 aout_symbol_type *new = (aout_symbol_type *) bfd_zalloc (abfd, amt); 1754 1797 if (!new) 1755 1798 return NULL; … … 1761 1804 /* Translate a set of internal symbols into external symbols. */ 1762 1805 1763 b oolean1806 bfd_boolean 1764 1807 NAME(aout,translate_symbol_table) (abfd, in, ext, count, str, strsize, dynamic) 1765 1808 bfd *abfd; … … 1769 1812 char *str; 1770 1813 bfd_size_type strsize; 1771 b oolean dynamic;1814 bfd_boolean dynamic; 1772 1815 { 1773 1816 struct external_nlist *ext_end; … … 1791 1834 in->symbol.name = str + x; 1792 1835 else 1793 return false;1836 return FALSE; 1794 1837 1795 1838 in->symbol.value = GET_SWORD (abfd, ext->e_value); 1796 in->desc = bfd_h_get_16 (abfd, ext->e_desc);1797 in->other = bfd_h_get_8 (abfd, ext->e_other);1798 in->type = bfd_h_get_8 (abfd, ext->e_type);1839 in->desc = H_GET_16 (abfd, ext->e_desc); 1840 in->other = H_GET_8 (abfd, ext->e_other); 1841 in->type = H_GET_8 (abfd, ext->e_type); 1799 1842 in->symbol.udata.p = NULL; 1800 1843 1801 1844 if (! translate_from_native_sym_flags (abfd, in)) 1802 return false;1845 return FALSE; 1803 1846 1804 1847 if (dynamic) … … 1806 1849 } 1807 1850 1808 return true;1851 return TRUE; 1809 1852 } 1810 1853 … … 1813 1856 hold them all plus all the cached symbol entries. */ 1814 1857 1815 b oolean1858 bfd_boolean 1816 1859 NAME(aout,slurp_symbol_table) (abfd) 1817 1860 bfd *abfd; … … 1819 1862 struct external_nlist *old_external_syms; 1820 1863 aout_symbol_type *cached; 1821 size_tcached_size;1822 1823 /* If there's no work to be done, don't do any */1864 bfd_size_type cached_size; 1865 1866 /* If there's no work to be done, don't do any. */ 1824 1867 if (obj_aout_symbols (abfd) != (aout_symbol_type *) NULL) 1825 return true;1868 return TRUE; 1826 1869 1827 1870 old_external_syms = obj_aout_external_syms (abfd); 1828 1871 1829 1872 if (! aout_get_external_symbols (abfd)) 1830 return false;1831 1832 cached_size = (obj_aout_external_sym_count (abfd)1833 * sizeof (aout_symbol_type));1834 cached = (aout_symbol_type *) bfd_ malloc (cached_size);1873 return FALSE; 1874 1875 cached_size = obj_aout_external_sym_count (abfd); 1876 cached_size *= sizeof (aout_symbol_type); 1877 cached = (aout_symbol_type *) bfd_zmalloc (cached_size); 1835 1878 if (cached == NULL && cached_size != 0) 1836 return false; 1837 if (cached_size != 0) 1838 memset (cached, 0, cached_size); 1879 return FALSE; 1839 1880 1840 1881 /* Convert from external symbol information to internal. */ … … 1845 1886 obj_aout_external_strings (abfd), 1846 1887 obj_aout_external_string_size (abfd), 1847 false)))1888 FALSE))) 1848 1889 { 1849 1890 free (cached); 1850 return false;1891 return FALSE; 1851 1892 } 1852 1893 … … 1870 1911 } 1871 1912 1872 return true;1913 return TRUE; 1873 1914 } 1874 1915 … … 1884 1925 1885 1926 static bfd_size_type add_to_stringtab 1886 PARAMS ((bfd *, struct bfd_strtab_hash *, const char *, boolean)); 1887 static boolean emit_stringtab PARAMS ((bfd *, struct bfd_strtab_hash *)); 1927 PARAMS ((bfd *, struct bfd_strtab_hash *, const char *, bfd_boolean)); 1928 static bfd_boolean emit_stringtab 1929 PARAMS ((bfd *, struct bfd_strtab_hash *)); 1888 1930 1889 1931 /* Get the index of a string in a strtab, adding it if it is not … … 1895 1937 struct bfd_strtab_hash *tab; 1896 1938 const char *str; 1897 b oolean copy;1898 { 1899 b oolean hash;1939 bfd_boolean copy; 1940 { 1941 bfd_boolean hash; 1900 1942 bfd_size_type index; 1901 1943 … … 1906 1948 /* Don't hash if BFD_TRADITIONAL_FORMAT is set, because SunOS dbx 1907 1949 doesn't understand a hashed string table. */ 1908 hash = true;1950 hash = TRUE; 1909 1951 if ((abfd->flags & BFD_TRADITIONAL_FORMAT) != 0) 1910 hash = false;1952 hash = FALSE; 1911 1953 1912 1954 index = _bfd_stringtab_add (tab, str, hash, copy); … … 1925 1967 file. */ 1926 1968 1927 static b oolean1969 static bfd_boolean 1928 1970 emit_stringtab (abfd, tab) 1929 1971 register bfd *abfd; … … 1931 1973 { 1932 1974 bfd_byte buffer[BYTES_IN_WORD]; 1975 bfd_size_type amt = BYTES_IN_WORD; 1933 1976 1934 1977 /* The string table starts with the size. */ 1935 1978 PUT_WORD (abfd, _bfd_stringtab_size (tab) + BYTES_IN_WORD, buffer); 1936 if (bfd_ write ((PTR) buffer, 1, BYTES_IN_WORD, abfd) != BYTES_IN_WORD)1937 return false;1979 if (bfd_bwrite ((PTR) buffer, amt, abfd) != amt) 1980 return FALSE; 1938 1981 1939 1982 return _bfd_stringtab_emit (abfd, tab); … … 1941 1984 1942 1985 1943 b oolean1986 bfd_boolean 1944 1987 NAME(aout,write_syms) (abfd) 1945 1988 bfd *abfd; … … 1951 1994 strtab = _bfd_stringtab_init (); 1952 1995 if (strtab == NULL) 1953 return false;1996 return FALSE; 1954 1997 1955 1998 for (count = 0; count < bfd_get_symcount (abfd); count++) … … 1958 2001 bfd_size_type indx; 1959 2002 struct external_nlist nsp; 1960 1961 indx = add_to_stringtab (abfd, strtab, g->name, false); 2003 bfd_size_type amt; 2004 2005 indx = add_to_stringtab (abfd, strtab, g->name, FALSE); 1962 2006 if (indx == (bfd_size_type) -1) 1963 2007 goto error_return; 1964 2008 PUT_WORD (abfd, indx, (bfd_byte *) nsp.e_strx); 1965 2009 1966 if (bfd_asymbol_flavour (g) == abfd->xvec->flavour)2010 if (bfd_asymbol_flavour (g) == abfd->xvec->flavour) 1967 2011 { 1968 bfd_h_put_16(abfd, aout_symbol(g)->desc, nsp.e_desc);1969 bfd_h_put_8(abfd, aout_symbol(g)->other,nsp.e_other);1970 bfd_h_put_8(abfd, aout_symbol(g)->type, nsp.e_type);2012 H_PUT_16 (abfd, aout_symbol (g)->desc, nsp.e_desc); 2013 H_PUT_8 (abfd, aout_symbol (g)->other, nsp.e_other); 2014 H_PUT_8 (abfd, aout_symbol (g)->type, nsp.e_type); 1971 2015 } 1972 2016 else 1973 2017 { 1974 bfd_h_put_16(abfd,0, nsp.e_desc);1975 bfd_h_put_8(abfd, 0, nsp.e_other);1976 bfd_h_put_8(abfd, 0, nsp.e_type);2018 H_PUT_16 (abfd, 0, nsp.e_desc); 2019 H_PUT_8 (abfd, 0, nsp.e_other); 2020 H_PUT_8 (abfd, 0, nsp.e_type); 1977 2021 } 1978 2022 … … 1980 2024 goto error_return; 1981 2025 1982 if (bfd_write((PTR)&nsp,1,EXTERNAL_NLIST_SIZE, abfd)1983 != EXTERNAL_NLIST_SIZE)2026 amt = EXTERNAL_NLIST_SIZE; 2027 if (bfd_bwrite ((PTR) &nsp, amt, abfd) != amt) 1984 2028 goto error_return; 1985 2029 … … 1994 2038 _bfd_stringtab_free (strtab); 1995 2039 1996 return true;2040 return TRUE; 1997 2041 1998 2042 error_return: 1999 2043 _bfd_stringtab_free (strtab); 2000 return false;2044 return FALSE; 2001 2045 } 2002 2046 … … 2013 2057 return -1; 2014 2058 2015 for (symbase = obj_aout_symbols(abfd); counter++ < bfd_get_symcount (abfd);) 2016 *(location++) = (asymbol *) ( symbase++); 2059 for (symbase = obj_aout_symbols (abfd); 2060 counter++ < bfd_get_symcount (abfd); 2061 ) 2062 *(location++) = (asymbol *) (symbase++); 2017 2063 *location++ =0; 2018 2064 return bfd_get_symcount (abfd); … … 2020 2066 2021 2067 2022 /* Standard reloc stuff */2068 /* Standard reloc stuff. */ 2023 2069 /* Output standard relocation information to a file in target byte order. */ 2024 2070 … … 2040 2086 asection *output_section = sym->section->output_section; 2041 2087 2042 PUT_WORD (abfd, g->address, natptr->r_address);2043 2044 r_length = g->howto->size ; /* Size as a power of two */2045 r_pcrel = (int) g->howto->pc_relative; /* Relative to PC? */2088 PUT_WORD (abfd, g->address, natptr->r_address); 2089 2090 r_length = g->howto->size ; /* Size as a power of two. */ 2091 r_pcrel = (int) g->howto->pc_relative; /* Relative to PC? */ 2046 2092 /* XXX This relies on relocs coming from a.out files. */ 2047 2093 r_baserel = (g->howto->type & 8) != 0; … … 2054 2100 #endif 2055 2101 2056 /* name was clobbered by aout_write_syms to be symbol index*/2102 /* Name was clobbered by aout_write_syms to be symbol index. */ 2057 2103 2058 2104 /* If this relocation is relative to a symbol then set the … … 2061 2107 Absolute symbols can come in in two ways, either as an offset 2062 2108 from the abs section, or as a symbol which has an abs value. 2063 check for that here 2064 */ 2109 check for that here. */ 2065 2110 2066 2111 if (bfd_is_com_section (output_section) … … 2069 2114 { 2070 2115 if (bfd_abs_section_ptr->symbol == sym) 2071 2072 /* Whoops, looked like an abs symbol, but is really an offset2073 from the abs section*/2074 r_index = N_ABS;2075 r_extern = 0;2076 2116 { 2117 /* Whoops, looked like an abs symbol, but is 2118 really an offset from the abs section. */ 2119 r_index = N_ABS; 2120 r_extern = 0; 2121 } 2077 2122 else 2078 { 2079 /* Fill in symbol */ 2080 r_extern = 1; 2081 r_index = (*(g->sym_ptr_ptr))->KEEPIT; 2082 2083 } 2123 { 2124 /* Fill in symbol. */ 2125 r_extern = 1; 2126 r_index = (*(g->sym_ptr_ptr))->KEEPIT; 2127 } 2084 2128 } 2085 2129 else 2086 2130 { 2087 /* Just an ordinary section */2131 /* Just an ordinary section. */ 2088 2132 r_extern = 0; 2089 2133 r_index = output_section->target_index; 2090 2134 } 2091 2135 2092 /* now the fun stuff */ 2093 if (bfd_header_big_endian (abfd)) { 2136 /* Now the fun stuff. */ 2137 if (bfd_header_big_endian (abfd)) 2138 { 2094 2139 natptr->r_index[0] = r_index >> 16; 2095 2140 natptr->r_index[1] = r_index >> 8; 2096 2141 natptr->r_index[2] = r_index; 2097 natptr->r_type[0] = 2098 (r_extern? RELOC_STD_BITS_EXTERN_BIG: 0)2099 | (r_pcrel? RELOC_STD_BITS_PCREL_BIG: 0)2100 | (r_baserel? RELOC_STD_BITS_BASEREL_BIG: 0)2101 | (r_jmptable? RELOC_STD_BITS_JMPTABLE_BIG: 0)2102 | (r_relative? RELOC_STD_BITS_RELATIVE_BIG: 0)2103 | (r_length << RELOC_STD_BITS_LENGTH_SH_BIG); 2104 } else {2105 natptr->r_index[2] = r_index >> 16; 2106 natptr->r_index[1] = r_index >> 8;2107 natptr->r_index[0] = r_index;2108 natptr->r_type[0] = 2109 (r_extern? RELOC_STD_BITS_EXTERN_LITTLE: 0)2110 | (r_pcrel? RELOC_STD_BITS_PCREL_LITTLE: 0)2111 | (r_baserel? RELOC_STD_BITS_BASEREL_LITTLE: 0)2112 | (r_jmptable? RELOC_STD_BITS_JMPTABLE_LITTLE: 0)2113 | (r_relative? RELOC_STD_BITS_RELATIVE_LITTLE: 0)2114 | (r_length << RELOC_STD_BITS_LENGTH_SH_LITTLE);2115 2116 } 2117 2118 /* Extended stuff */2142 natptr->r_type[0] = ((r_extern ? RELOC_STD_BITS_EXTERN_BIG : 0) 2143 | (r_pcrel ? RELOC_STD_BITS_PCREL_BIG : 0) 2144 | (r_baserel ? RELOC_STD_BITS_BASEREL_BIG : 0) 2145 | (r_jmptable ? RELOC_STD_BITS_JMPTABLE_BIG : 0) 2146 | (r_relative ? RELOC_STD_BITS_RELATIVE_BIG : 0) 2147 | (r_length << RELOC_STD_BITS_LENGTH_SH_BIG)); 2148 } 2149 else 2150 { 2151 natptr->r_index[2] = r_index >> 16; 2152 natptr->r_index[1] = r_index >> 8; 2153 natptr->r_index[0] = r_index; 2154 natptr->r_type[0] = ((r_extern ? RELOC_STD_BITS_EXTERN_LITTLE : 0) 2155 | (r_pcrel ? RELOC_STD_BITS_PCREL_LITTLE : 0) 2156 | (r_baserel ? RELOC_STD_BITS_BASEREL_LITTLE : 0) 2157 | (r_jmptable ? RELOC_STD_BITS_JMPTABLE_LITTLE : 0) 2158 | (r_relative ? RELOC_STD_BITS_RELATIVE_LITTLE : 0) 2159 | (r_length << RELOC_STD_BITS_LENGTH_SH_LITTLE)); 2160 } 2161 } 2162 2163 /* Extended stuff. */ 2119 2164 /* Output extended relocation information to a file in target byte order. */ 2120 2165 … … 2131 2176 int r_extern; 2132 2177 unsigned int r_type; 2133 unsigned intr_addend;2178 bfd_vma r_addend; 2134 2179 asymbol *sym = *(g->sym_ptr_ptr); 2135 2180 asection *output_section = sym->section->output_section; … … 2149 2194 from the abs section, or as a symbol which has an abs value. 2150 2195 check for that here. */ 2151 2152 2196 if (bfd_is_abs_section (bfd_get_section (sym))) 2153 2197 { … … 2166 2210 else 2167 2211 { 2168 /* Just an ordinary section */2212 /* Just an ordinary section. */ 2169 2213 r_extern = 0; 2170 2214 r_index = output_section->target_index; 2171 2215 } 2172 2216 2173 /* now the fun stuff */ 2174 if (bfd_header_big_endian (abfd)) { 2175 natptr->r_index[0] = r_index >> 16; 2176 natptr->r_index[1] = r_index >> 8; 2177 natptr->r_index[2] = r_index; 2178 natptr->r_type[0] = 2179 ((r_extern? RELOC_EXT_BITS_EXTERN_BIG: 0) 2180 | (r_type << RELOC_EXT_BITS_TYPE_SH_BIG)); 2181 } else { 2182 natptr->r_index[2] = r_index >> 16; 2183 natptr->r_index[1] = r_index >> 8; 2184 natptr->r_index[0] = r_index; 2185 natptr->r_type[0] = 2186 (r_extern? RELOC_EXT_BITS_EXTERN_LITTLE: 0) 2187 | (r_type << RELOC_EXT_BITS_TYPE_SH_LITTLE); 2188 } 2217 /* Now the fun stuff. */ 2218 if (bfd_header_big_endian (abfd)) 2219 { 2220 natptr->r_index[0] = r_index >> 16; 2221 natptr->r_index[1] = r_index >> 8; 2222 natptr->r_index[2] = r_index; 2223 natptr->r_type[0] = ((r_extern ? RELOC_EXT_BITS_EXTERN_BIG : 0) 2224 | (r_type << RELOC_EXT_BITS_TYPE_SH_BIG)); 2225 } 2226 else 2227 { 2228 natptr->r_index[2] = r_index >> 16; 2229 natptr->r_index[1] = r_index >> 8; 2230 natptr->r_index[0] = r_index; 2231 natptr->r_type[0] = ((r_extern ? RELOC_EXT_BITS_EXTERN_LITTLE : 0) 2232 | (r_type << RELOC_EXT_BITS_TYPE_SH_LITTLE)); 2233 } 2189 2234 2190 2235 PUT_WORD (abfd, r_addend, natptr->r_addend); … … 2197 2242 Aout keeps all it's symbols based from zero, so the symbol would 2198 2243 contain 60. This macro subs the base of each section from the value 2199 to give the true offset from the section */ 2200 2201 #define MOVE_ADDRESS(ad) \ 2202 if (r_extern) { \ 2203 /* undefined symbol */ \ 2204 cache_ptr->sym_ptr_ptr = symbols + r_index; \ 2205 cache_ptr->addend = ad; \ 2206 } else { \ 2207 /* defined, section relative. replace symbol with pointer to \ 2208 symbol which points to section */ \ 2209 switch (r_index) { \ 2210 case N_TEXT: \ 2211 case N_TEXT | N_EXT: \ 2212 cache_ptr->sym_ptr_ptr = obj_textsec(abfd)->symbol_ptr_ptr; \ 2213 cache_ptr->addend = ad - su->textsec->vma; \ 2214 break; \ 2215 case N_DATA: \ 2216 case N_DATA | N_EXT: \ 2217 cache_ptr->sym_ptr_ptr = obj_datasec(abfd)->symbol_ptr_ptr; \ 2218 cache_ptr->addend = ad - su->datasec->vma; \ 2219 break; \ 2220 case N_BSS: \ 2221 case N_BSS | N_EXT: \ 2222 cache_ptr->sym_ptr_ptr = obj_bsssec(abfd)->symbol_ptr_ptr; \ 2223 cache_ptr->addend = ad - su->bsssec->vma; \ 2224 break; \ 2225 default: \ 2226 case N_ABS: \ 2227 case N_ABS | N_EXT: \ 2228 cache_ptr->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr; \ 2244 to give the true offset from the section. */ 2245 2246 #define MOVE_ADDRESS(ad) \ 2247 if (r_extern) \ 2248 { \ 2249 /* Undefined symbol. */ \ 2250 cache_ptr->sym_ptr_ptr = symbols + r_index; \ 2229 2251 cache_ptr->addend = ad; \ 2230 break; \2231 2252 } \ 2232 } \ 2253 else \ 2254 { \ 2255 /* Defined, section relative. Replace symbol with pointer to \ 2256 symbol which points to section. */ \ 2257 switch (r_index) \ 2258 { \ 2259 case N_TEXT: \ 2260 case N_TEXT | N_EXT: \ 2261 cache_ptr->sym_ptr_ptr = obj_textsec (abfd)->symbol_ptr_ptr; \ 2262 cache_ptr->addend = ad - su->textsec->vma; \ 2263 break; \ 2264 case N_DATA: \ 2265 case N_DATA | N_EXT: \ 2266 cache_ptr->sym_ptr_ptr = obj_datasec (abfd)->symbol_ptr_ptr; \ 2267 cache_ptr->addend = ad - su->datasec->vma; \ 2268 break; \ 2269 case N_BSS: \ 2270 case N_BSS | N_EXT: \ 2271 cache_ptr->sym_ptr_ptr = obj_bsssec (abfd)->symbol_ptr_ptr; \ 2272 cache_ptr->addend = ad - su->bsssec->vma; \ 2273 break; \ 2274 default: \ 2275 case N_ABS: \ 2276 case N_ABS | N_EXT: \ 2277 cache_ptr->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr; \ 2278 cache_ptr->addend = ad; \ 2279 break; \ 2280 } \ 2281 } 2233 2282 2234 2283 void … … 2247 2296 cache_ptr->address = (GET_SWORD (abfd, bytes->r_address)); 2248 2297 2249 /* now the fun stuff */ 2250 if (bfd_header_big_endian (abfd)) { 2251 r_index = (bytes->r_index[0] << 16) 2252 | (bytes->r_index[1] << 8) 2253 | bytes->r_index[2]; 2254 r_extern = (0 != (bytes->r_type[0] & RELOC_EXT_BITS_EXTERN_BIG)); 2255 r_type = (bytes->r_type[0] & RELOC_EXT_BITS_TYPE_BIG) 2256 >> RELOC_EXT_BITS_TYPE_SH_BIG; 2257 } else { 2258 r_index = (bytes->r_index[2] << 16) 2259 | (bytes->r_index[1] << 8) 2260 | bytes->r_index[0]; 2261 r_extern = (0 != (bytes->r_type[0] & RELOC_EXT_BITS_EXTERN_LITTLE)); 2262 r_type = (bytes->r_type[0] & RELOC_EXT_BITS_TYPE_LITTLE) 2263 >> RELOC_EXT_BITS_TYPE_SH_LITTLE; 2264 } 2298 /* Now the fun stuff. */ 2299 if (bfd_header_big_endian (abfd)) 2300 { 2301 r_index = (((unsigned int) bytes->r_index[0] << 16) 2302 | ((unsigned int) bytes->r_index[1] << 8) 2303 | bytes->r_index[2]); 2304 r_extern = (0 != (bytes->r_type[0] & RELOC_EXT_BITS_EXTERN_BIG)); 2305 r_type = ((bytes->r_type[0] & RELOC_EXT_BITS_TYPE_BIG) 2306 >> RELOC_EXT_BITS_TYPE_SH_BIG); 2307 } 2308 else 2309 { 2310 r_index = (((unsigned int) bytes->r_index[2] << 16) 2311 | ((unsigned int) bytes->r_index[1] << 8) 2312 | bytes->r_index[0]); 2313 r_extern = (0 != (bytes->r_type[0] & RELOC_EXT_BITS_EXTERN_LITTLE)); 2314 r_type = ((bytes->r_type[0] & RELOC_EXT_BITS_TYPE_LITTLE) 2315 >> RELOC_EXT_BITS_TYPE_SH_LITTLE); 2316 } 2265 2317 2266 2318 cache_ptr->howto = howto_table_ext + r_type; … … 2269 2321 regardless of the setting of r_extern. r_extern just reflects 2270 2322 whether the symbol the reloc is against is local or global. */ 2271 if (r_type == RELOC_BASE102272 || r_type == RELOC_BASE132273 || r_type == RELOC_BASE22)2323 if (r_type == (unsigned int) RELOC_BASE10 2324 || r_type == (unsigned int) RELOC_BASE13 2325 || r_type == (unsigned int) RELOC_BASE22) 2274 2326 r_extern = 1; 2275 2327 … … 2282 2334 } 2283 2335 2284 MOVE_ADDRESS (GET_SWORD(abfd, bytes->r_addend));2336 MOVE_ADDRESS (GET_SWORD (abfd, bytes->r_addend)); 2285 2337 } 2286 2338 … … 2301 2353 unsigned int howto_idx; 2302 2354 2303 cache_ptr->address = bfd_h_get_32 (abfd, bytes->r_address); 2304 2305 /* now the fun stuff */ 2306 if (bfd_header_big_endian (abfd)) { 2307 r_index = (bytes->r_index[0] << 16) 2308 | (bytes->r_index[1] << 8) 2309 | bytes->r_index[2]; 2310 r_extern = (0 != (bytes->r_type[0] & RELOC_STD_BITS_EXTERN_BIG)); 2311 r_pcrel = (0 != (bytes->r_type[0] & RELOC_STD_BITS_PCREL_BIG)); 2312 r_baserel = (0 != (bytes->r_type[0] & RELOC_STD_BITS_BASEREL_BIG)); 2313 r_jmptable= (0 != (bytes->r_type[0] & RELOC_STD_BITS_JMPTABLE_BIG)); 2314 r_relative= (0 != (bytes->r_type[0] & RELOC_STD_BITS_RELATIVE_BIG)); 2315 r_length = (bytes->r_type[0] & RELOC_STD_BITS_LENGTH_BIG) 2316 >> RELOC_STD_BITS_LENGTH_SH_BIG; 2317 } else { 2318 r_index = (bytes->r_index[2] << 16) 2319 | (bytes->r_index[1] << 8) 2320 | bytes->r_index[0]; 2321 r_extern = (0 != (bytes->r_type[0] & RELOC_STD_BITS_EXTERN_LITTLE)); 2322 r_pcrel = (0 != (bytes->r_type[0] & RELOC_STD_BITS_PCREL_LITTLE)); 2323 r_baserel = (0 != (bytes->r_type[0] & RELOC_STD_BITS_BASEREL_LITTLE)); 2324 r_jmptable= (0 != (bytes->r_type[0] & RELOC_STD_BITS_JMPTABLE_LITTLE)); 2325 r_relative= (0 != (bytes->r_type[0] & RELOC_STD_BITS_RELATIVE_LITTLE)); 2326 r_length = (bytes->r_type[0] & RELOC_STD_BITS_LENGTH_LITTLE) 2327 >> RELOC_STD_BITS_LENGTH_SH_LITTLE; 2328 } 2329 2330 howto_idx = r_length + 4 * r_pcrel + 8 * r_baserel 2331 + 16 * r_jmptable + 32 * r_relative; 2355 cache_ptr->address = H_GET_32 (abfd, bytes->r_address); 2356 2357 /* Now the fun stuff. */ 2358 if (bfd_header_big_endian (abfd)) 2359 { 2360 r_index = (((unsigned int) bytes->r_index[0] << 16) 2361 | ((unsigned int) bytes->r_index[1] << 8) 2362 | bytes->r_index[2]); 2363 r_extern = (0 != (bytes->r_type[0] & RELOC_STD_BITS_EXTERN_BIG)); 2364 r_pcrel = (0 != (bytes->r_type[0] & RELOC_STD_BITS_PCREL_BIG)); 2365 r_baserel = (0 != (bytes->r_type[0] & RELOC_STD_BITS_BASEREL_BIG)); 2366 r_jmptable= (0 != (bytes->r_type[0] & RELOC_STD_BITS_JMPTABLE_BIG)); 2367 r_relative= (0 != (bytes->r_type[0] & RELOC_STD_BITS_RELATIVE_BIG)); 2368 r_length = ((bytes->r_type[0] & RELOC_STD_BITS_LENGTH_BIG) 2369 >> RELOC_STD_BITS_LENGTH_SH_BIG); 2370 } 2371 else 2372 { 2373 r_index = (((unsigned int) bytes->r_index[2] << 16) 2374 | ((unsigned int) bytes->r_index[1] << 8) 2375 | bytes->r_index[0]); 2376 r_extern = (0 != (bytes->r_type[0] & RELOC_STD_BITS_EXTERN_LITTLE)); 2377 r_pcrel = (0 != (bytes->r_type[0] & RELOC_STD_BITS_PCREL_LITTLE)); 2378 r_baserel = (0 != (bytes->r_type[0] & RELOC_STD_BITS_BASEREL_LITTLE)); 2379 r_jmptable= (0 != (bytes->r_type[0] & RELOC_STD_BITS_JMPTABLE_LITTLE)); 2380 r_relative= (0 != (bytes->r_type[0] & RELOC_STD_BITS_RELATIVE_LITTLE)); 2381 r_length = ((bytes->r_type[0] & RELOC_STD_BITS_LENGTH_LITTLE) 2382 >> RELOC_STD_BITS_LENGTH_SH_LITTLE); 2383 } 2384 2385 howto_idx = (r_length + 4 * r_pcrel + 8 * r_baserel 2386 + 16 * r_jmptable + 32 * r_relative); 2332 2387 BFD_ASSERT (howto_idx < TABLE_SIZE (howto_table_std)); 2333 2388 cache_ptr->howto = howto_table_std + howto_idx; … … 2348 2403 } 2349 2404 2350 MOVE_ADDRESS (0);2405 MOVE_ADDRESS (0); 2351 2406 } 2352 2407 2353 2408 /* Read and swap the relocs for a section. */ 2354 2409 2355 b oolean2410 bfd_boolean 2356 2411 NAME(aout,slurp_reloc_table) (abfd, asect, symbols) 2357 2412 bfd *abfd; … … 2359 2414 asymbol **symbols; 2360 2415 { 2361 unsigned intcount;2416 bfd_size_type count; 2362 2417 bfd_size_type reloc_size; 2363 2418 PTR relocs; … … 2366 2421 unsigned int counter = 0; 2367 2422 arelent *cache_ptr; 2423 bfd_size_type amt; 2368 2424 2369 2425 if (asect->relocation) 2370 return true;2426 return TRUE; 2371 2427 2372 2428 if (asect->flags & SEC_CONSTRUCTOR) 2373 return true;2429 return TRUE; 2374 2430 2375 2431 if (asect == obj_datasec (abfd)) 2376 reloc_size = exec_hdr (abfd)->a_drsize;2432 reloc_size = exec_hdr (abfd)->a_drsize; 2377 2433 else if (asect == obj_textsec (abfd)) 2378 reloc_size = exec_hdr (abfd)->a_trsize;2434 reloc_size = exec_hdr (abfd)->a_trsize; 2379 2435 else if (asect == obj_bsssec (abfd)) 2380 2436 reloc_size = 0; … … 2382 2438 { 2383 2439 bfd_set_error (bfd_error_invalid_operation); 2384 return false;2440 return FALSE; 2385 2441 } 2386 2442 2387 2443 if (bfd_seek (abfd, asect->rel_filepos, SEEK_SET) != 0) 2388 return false;2444 return FALSE; 2389 2445 2390 2446 each_size = obj_reloc_entry_size (abfd); … … 2392 2448 count = reloc_size / each_size; 2393 2449 2394 reloc_cache = (arelent *) bfd_malloc ((size_t) (count * sizeof (arelent))); 2450 amt = count * sizeof (arelent); 2451 reloc_cache = (arelent *) bfd_zmalloc (amt); 2395 2452 if (reloc_cache == NULL && count != 0) 2396 return false; 2397 memset (reloc_cache, 0, count * sizeof (arelent)); 2398 2399 relocs = bfd_malloc ((size_t) reloc_size); 2453 return FALSE; 2454 2455 relocs = bfd_malloc (reloc_size); 2400 2456 if (relocs == NULL && reloc_size != 0) 2401 2457 { 2402 2458 free (reloc_cache); 2403 return false;2404 } 2405 2406 if (bfd_ read (relocs, 1, reloc_size, abfd) != reloc_size)2459 return FALSE; 2460 } 2461 2462 if (bfd_bread (relocs, reloc_size, abfd) != reloc_size) 2407 2463 { 2408 2464 free (relocs); 2409 2465 free (reloc_cache); 2410 return false;2466 return FALSE; 2411 2467 } 2412 2468 … … 2414 2470 if (each_size == RELOC_EXT_SIZE) 2415 2471 { 2416 register struct reloc_ext_external *rptr = 2417 (struct reloc_ext_external *) relocs; 2472 struct reloc_ext_external *rptr = (struct reloc_ext_external *) relocs; 2418 2473 2419 2474 for (; counter < count; counter++, rptr++, cache_ptr++) 2420 2475 MY_swap_ext_reloc_in (abfd, rptr, cache_ptr, symbols, 2421 bfd_get_symcount (abfd));2476 (bfd_size_type) bfd_get_symcount (abfd)); 2422 2477 } 2423 2478 else 2424 2479 { 2425 register struct reloc_std_external *rptr = 2426 (struct reloc_std_external *) relocs; 2480 struct reloc_std_external *rptr = (struct reloc_std_external *) relocs; 2427 2481 2428 2482 for (; counter < count; counter++, rptr++, cache_ptr++) 2429 2483 MY_swap_std_reloc_in (abfd, rptr, cache_ptr, symbols, 2430 bfd_get_symcount (abfd));2484 (bfd_size_type) bfd_get_symcount (abfd)); 2431 2485 } 2432 2486 … … 2436 2490 asect->reloc_count = cache_ptr - reloc_cache; 2437 2491 2438 return true;2492 return TRUE; 2439 2493 } 2440 2494 2441 2495 /* Write out a relocation section into an object file. */ 2442 2496 2443 b oolean2497 bfd_boolean 2444 2498 NAME(aout,squirt_out_relocs) (abfd, section) 2445 2499 bfd *abfd; … … 2451 2505 2452 2506 unsigned int count = section->reloc_count; 2453 size_tnatsize;2507 bfd_size_type natsize; 2454 2508 2455 2509 if (count == 0 || section->orelocation == NULL) 2456 return true;2510 return TRUE; 2457 2511 2458 2512 each_size = obj_reloc_entry_size (abfd); 2459 natsize = each_size * count;2513 natsize = (bfd_size_type) each_size * count; 2460 2514 native = (unsigned char *) bfd_zalloc (abfd, natsize); 2461 2515 if (!native) 2462 return false;2516 return FALSE; 2463 2517 2464 2518 generic = section->orelocation; … … 2477 2531 count != 0; 2478 2532 --count, natptr += each_size, ++generic) 2479 MY_swap_std_reloc_out(abfd, *generic, (struct reloc_std_external *)natptr); 2480 } 2481 2482 if ( bfd_write ((PTR) native, 1, natsize, abfd) != natsize) { 2483 bfd_release(abfd, native); 2484 return false; 2485 } 2533 MY_swap_std_reloc_out (abfd, *generic, 2534 (struct reloc_std_external *) natptr); 2535 } 2536 2537 if (bfd_bwrite ((PTR) native, natsize, abfd) != natsize) 2538 { 2539 bfd_release (abfd, native); 2540 return FALSE; 2541 } 2486 2542 bfd_release (abfd, native); 2487 2543 2488 return true; 2489 } 2490 2491 /* This is stupid. This function should be a boolean predicate */ 2544 return TRUE; 2545 } 2546 2547 /* This is stupid. This function should be a boolean predicate. */ 2548 2492 2549 long 2493 2550 NAME(aout,canonicalize_reloc) (abfd, section, relptr, symbols) … … 2509 2566 return -1; 2510 2567 2511 if (section->flags & SEC_CONSTRUCTOR) { 2512 arelent_chain *chain = section->constructor_chain; 2513 for (count = 0; count < section->reloc_count; count ++) { 2514 *relptr ++ = &chain->relent; 2515 chain = chain->next; 2516 } 2517 } 2518 else { 2519 tblptr = section->relocation; 2520 2521 for (count = 0; count++ < section->reloc_count;) 2522 { 2523 *relptr++ = tblptr++; 2524 } 2525 } 2568 if (section->flags & SEC_CONSTRUCTOR) 2569 { 2570 arelent_chain *chain = section->constructor_chain; 2571 for (count = 0; count < section->reloc_count; count ++) 2572 { 2573 *relptr ++ = &chain->relent; 2574 chain = chain->next; 2575 } 2576 } 2577 else 2578 { 2579 tblptr = section->relocation; 2580 2581 for (count = 0; count++ < section->reloc_count; ) 2582 { 2583 *relptr++ = tblptr++; 2584 } 2585 } 2526 2586 *relptr = 0; 2527 2587 … … 2534 2594 sec_ptr asect; 2535 2595 { 2536 if (bfd_get_format (abfd) != bfd_object) { 2537 bfd_set_error (bfd_error_invalid_operation); 2538 return -1; 2539 } 2540 if (asect->flags & SEC_CONSTRUCTOR) { 2596 if (bfd_get_format (abfd) != bfd_object) 2597 { 2598 bfd_set_error (bfd_error_invalid_operation); 2599 return -1; 2600 } 2601 2602 if (asect->flags & SEC_CONSTRUCTOR) 2541 2603 return (sizeof (arelent *) * (asect->reloc_count+1)); 2542 }2543 2604 2544 2605 if (asect == obj_datasec (abfd)) 2545 2606 return (sizeof (arelent *) 2546 * ((exec_hdr (abfd)->a_drsize / obj_reloc_entry_size (abfd))2607 * ((exec_hdr (abfd)->a_drsize / obj_reloc_entry_size (abfd)) 2547 2608 + 1)); 2548 2609 2549 2610 if (asect == obj_textsec (abfd)) 2550 2611 return (sizeof (arelent *) 2551 * ((exec_hdr (abfd)->a_trsize / obj_reloc_entry_size (abfd))2612 * ((exec_hdr (abfd)->a_trsize / obj_reloc_entry_size (abfd)) 2552 2613 + 1)); 2553 2614 … … 2573 2634 } 2574 2635 2575 2636 alent * 2576 2637 NAME(aout,get_lineno) (ignore_abfd, ignore_symbol) 2577 2638 bfd *ignore_abfd ATTRIBUTE_UNUSED; … … 2591 2652 if (ret->type == '?') 2592 2653 { 2593 int type_code = aout_symbol (symbol)->type & 0xff;2654 int type_code = aout_symbol (symbol)->type & 0xff; 2594 2655 const char *stab_name = bfd_get_stab_name (type_code); 2595 2656 static char buf[10]; … … 2602 2663 ret->type = '-'; 2603 2664 ret->stab_type = type_code; 2604 ret->stab_other = (unsigned) (aout_symbol (symbol)->other & 0xff);2605 ret->stab_desc = (unsigned) (aout_symbol (symbol)->desc & 0xffff);2665 ret->stab_other = (unsigned) (aout_symbol (symbol)->other & 0xff); 2666 ret->stab_desc = (unsigned) (aout_symbol (symbol)->desc & 0xffff); 2606 2667 ret->stab_name = stab_name; 2607 2668 } … … 2609 2670 2610 2671 void 2611 NAME(aout,print_symbol) ( ignore_abfd, afile, symbol, how)2612 bfd * ignore_abfd ATTRIBUTE_UNUSED;2672 NAME(aout,print_symbol) (abfd, afile, symbol, how) 2673 bfd *abfd; 2613 2674 PTR afile; 2614 2675 asymbol *symbol; … … 2617 2678 FILE *file = (FILE *)afile; 2618 2679 2619 switch (how) { 2620 case bfd_print_symbol_name: 2621 if (symbol->name) 2622 fprintf (file,"%s", symbol->name); 2623 break; 2624 case bfd_print_symbol_more: 2625 fprintf (file,"%4x %2x %2x",(unsigned) (aout_symbol(symbol)->desc & 0xffff), 2626 (unsigned) (aout_symbol(symbol)->other & 0xff), 2627 (unsigned) (aout_symbol(symbol)->type)); 2628 break; 2629 case bfd_print_symbol_all: 2630 { 2631 CONST char *section_name = symbol->section->name; 2632 2633 bfd_print_symbol_vandf((PTR)file,symbol); 2634 2635 fprintf (file," %-5s %04x %02x %02x", 2636 section_name, 2637 (unsigned) (aout_symbol(symbol)->desc & 0xffff), 2638 (unsigned) (aout_symbol(symbol)->other & 0xff), 2639 (unsigned) (aout_symbol(symbol)->type & 0xff)); 2680 switch (how) 2681 { 2682 case bfd_print_symbol_name: 2640 2683 if (symbol->name) 2641 fprintf (file," %s", symbol->name); 2642 } 2643 break; 2644 } 2684 fprintf (file,"%s", symbol->name); 2685 break; 2686 case bfd_print_symbol_more: 2687 fprintf (file,"%4x %2x %2x", 2688 (unsigned) (aout_symbol (symbol)->desc & 0xffff), 2689 (unsigned) (aout_symbol (symbol)->other & 0xff), 2690 (unsigned) (aout_symbol (symbol)->type)); 2691 break; 2692 case bfd_print_symbol_all: 2693 { 2694 const char *section_name = symbol->section->name; 2695 2696 bfd_print_symbol_vandf (abfd, (PTR)file, symbol); 2697 2698 fprintf (file," %-5s %04x %02x %02x", 2699 section_name, 2700 (unsigned) (aout_symbol (symbol)->desc & 0xffff), 2701 (unsigned) (aout_symbol (symbol)->other & 0xff), 2702 (unsigned) (aout_symbol (symbol)->type & 0xff)); 2703 if (symbol->name) 2704 fprintf (file," %s", symbol->name); 2705 } 2706 break; 2707 } 2645 2708 } 2646 2709 … … 2657 2720 NAME(aout,read_minisymbols) (abfd, dynamic, minisymsp, sizep) 2658 2721 bfd *abfd; 2659 b oolean dynamic;2722 bfd_boolean dynamic; 2660 2723 PTR *minisymsp; 2661 2724 unsigned int *sizep; … … 2693 2756 NAME(aout,minisymbol_to_symbol) (abfd, dynamic, minisym, sym) 2694 2757 bfd *abfd; 2695 b oolean dynamic;2758 bfd_boolean dynamic; 2696 2759 const PTR minisym; 2697 2760 asymbol *sym; … … 2711 2774 obj_aout_external_strings (abfd), 2712 2775 obj_aout_external_string_size (abfd), 2713 false)))2776 FALSE))) 2714 2777 return NULL; 2715 2778 … … 2717 2780 } 2718 2781 2719 /* 2720 provided a BFD, a section and an offset into the section, calculate 2721 and return the name of the source file and the line nearest to the 2722 wanted location. 2723 */ 2724 2725 boolean 2782 /* Provided a BFD, a section and an offset into the section, calculate 2783 and return the name of the source file and the line nearest to the 2784 wanted location. */ 2785 2786 bfd_boolean 2726 2787 NAME(aout,find_nearest_line) 2727 2788 (abfd, section, symbols, offset, filename_ptr, functionname_ptr, line_ptr) … … 2730 2791 asymbol **symbols; 2731 2792 bfd_vma offset; 2732 CONSTchar **filename_ptr;2733 CONSTchar **functionname_ptr;2793 const char **filename_ptr; 2794 const char **functionname_ptr; 2734 2795 unsigned int *line_ptr; 2735 2796 { 2736 /* Run down the file looking for the filename, function and linenumber */2797 /* Run down the file looking for the filename, function and linenumber. */ 2737 2798 asymbol **p; 2738 CONSTchar *directory_name = NULL;2739 CONSTchar *main_file_name = NULL;2740 CONSTchar *current_file_name = NULL;2741 CONSTchar *line_file_name = NULL; /* Value of current_file_name at line number. */2742 CONSTchar *line_directory_name = NULL; /* Value of directory_name at line number. */2799 const char *directory_name = NULL; 2800 const char *main_file_name = NULL; 2801 const char *current_file_name = NULL; 2802 const char *line_file_name = NULL; /* Value of current_file_name at line number. */ 2803 const char *line_directory_name = NULL; /* Value of directory_name at line number. */ 2743 2804 bfd_vma low_line_vma = 0; 2744 2805 bfd_vma low_func_vma = 0; 2745 2806 asymbol *func = 0; 2746 size_tfilelen, funclen;2807 bfd_size_type filelen, funclen; 2747 2808 char *buf; 2748 2809 … … 2750 2811 *functionname_ptr = 0; 2751 2812 *line_ptr = 0; 2752 if (symbols != (asymbol **)NULL) { 2753 for (p = symbols; *p; p++) { 2754 aout_symbol_type *q = (aout_symbol_type *) (*p); 2755 next: 2756 switch (q->type){ 2757 case N_TEXT: 2758 /* If this looks like a file name symbol, and it comes after 2759 the line number we have found so far, but before the 2760 offset, then we have probably not found the right line 2761 number. */ 2762 if (q->symbol.value <= offset 2763 && ((q->symbol.value > low_line_vma 2764 && (line_file_name != NULL 2765 || *line_ptr != 0)) 2766 || (q->symbol.value > low_func_vma 2767 && func != NULL))) 2768 { 2769 const char *symname; 2770 2771 symname = q->symbol.name; 2772 if (strcmp (symname + strlen (symname) - 2, ".o") == 0) 2813 2814 if (symbols != (asymbol **)NULL) 2815 { 2816 for (p = symbols; *p; p++) 2817 { 2818 aout_symbol_type *q = (aout_symbol_type *) (*p); 2819 next: 2820 switch (q->type) 2821 { 2822 case N_TEXT: 2823 /* If this looks like a file name symbol, and it comes after 2824 the line number we have found so far, but before the 2825 offset, then we have probably not found the right line 2826 number. */ 2827 if (q->symbol.value <= offset 2828 && ((q->symbol.value > low_line_vma 2829 && (line_file_name != NULL 2830 || *line_ptr != 0)) 2831 || (q->symbol.value > low_func_vma 2832 && func != NULL))) 2833 { 2834 const char *symname; 2835 2836 symname = q->symbol.name; 2837 if (strcmp (symname + strlen (symname) - 2, ".o") == 0) 2838 { 2839 if (q->symbol.value > low_line_vma) 2840 { 2841 *line_ptr = 0; 2842 line_file_name = NULL; 2843 } 2844 if (q->symbol.value > low_func_vma) 2845 func = NULL; 2846 } 2847 } 2848 break; 2849 2850 case N_SO: 2851 /* If this symbol is less than the offset, but greater than 2852 the line number we have found so far, then we have not 2853 found the right line number. */ 2854 if (q->symbol.value <= offset) 2855 { 2856 if (q->symbol.value > low_line_vma) 2857 { 2858 *line_ptr = 0; 2859 line_file_name = NULL; 2860 } 2861 if (q->symbol.value > low_func_vma) 2862 func = NULL; 2863 } 2864 2865 main_file_name = current_file_name = q->symbol.name; 2866 /* Look ahead to next symbol to check if that too is an N_SO. */ 2867 p++; 2868 if (*p == NULL) 2869 break; 2870 q = (aout_symbol_type *) (*p); 2871 if (q->type != (int)N_SO) 2872 goto next; 2873 2874 /* Found a second N_SO First is directory; second is filename. */ 2875 directory_name = current_file_name; 2876 main_file_name = current_file_name = q->symbol.name; 2877 if (obj_textsec (abfd) != section) 2878 goto done; 2879 break; 2880 case N_SOL: 2881 current_file_name = q->symbol.name; 2882 break; 2883 2884 case N_SLINE: 2885 2886 case N_DSLINE: 2887 case N_BSLINE: 2888 /* We'll keep this if it resolves nearer than the one we have 2889 already. */ 2890 if (q->symbol.value >= low_line_vma 2891 && q->symbol.value <= offset) 2892 { 2893 *line_ptr = q->desc; 2894 low_line_vma = q->symbol.value; 2895 line_file_name = current_file_name; 2896 line_directory_name = directory_name; 2897 } 2898 break; 2899 case N_FUN: 2773 2900 { 2774 if (q->symbol.value > low_line_vma) 2901 /* We'll keep this if it is nearer than the one we have already. */ 2902 if (q->symbol.value >= low_func_vma && 2903 q->symbol.value <= offset) 2775 2904 { 2776 *line_ptr = 0;2777 line_file_name = NULL;2905 low_func_vma = q->symbol.value; 2906 func = (asymbol *)q; 2778 2907 } 2779 if (q->symbol.value > low_func_vma)2780 func = NULL;2908 else if (q->symbol.value > offset) 2909 goto done; 2781 2910 } 2782 } 2783 break; 2784 2785 case N_SO: 2786 /* If this symbol is less than the offset, but greater than 2787 the line number we have found so far, then we have not 2788 found the right line number. */ 2789 if (q->symbol.value <= offset) 2790 { 2791 if (q->symbol.value > low_line_vma) 2792 { 2793 *line_ptr = 0; 2794 line_file_name = NULL; 2795 } 2796 if (q->symbol.value > low_func_vma) 2797 func = NULL; 2798 } 2799 2800 main_file_name = current_file_name = q->symbol.name; 2801 /* Look ahead to next symbol to check if that too is an N_SO. */ 2802 p++; 2803 if (*p == NULL) 2804 break; 2805 q = (aout_symbol_type *) (*p); 2806 if (q->type != (int)N_SO) 2807 goto next; 2808 2809 /* Found a second N_SO First is directory; second is filename. */ 2810 directory_name = current_file_name; 2811 main_file_name = current_file_name = q->symbol.name; 2812 if (obj_textsec(abfd) != section) 2813 goto done; 2814 break; 2815 case N_SOL: 2816 current_file_name = q->symbol.name; 2817 break; 2818 2819 case N_SLINE: 2820 2821 case N_DSLINE: 2822 case N_BSLINE: 2823 /* We'll keep this if it resolves nearer than the one we have 2824 already. */ 2825 if (q->symbol.value >= low_line_vma 2826 && q->symbol.value <= offset) 2827 { 2828 *line_ptr = q->desc; 2829 low_line_vma = q->symbol.value; 2830 line_file_name = current_file_name; 2831 line_directory_name = directory_name; 2832 } 2833 break; 2834 case N_FUN: 2835 { 2836 /* We'll keep this if it is nearer than the one we have already */ 2837 if (q->symbol.value >= low_func_vma && 2838 q->symbol.value <= offset) { 2839 low_func_vma = q->symbol.value; 2840 func = (asymbol *)q; 2841 } 2842 else if (q->symbol.value > offset) 2843 goto done; 2911 break; 2912 } 2844 2913 } 2845 break; 2846 } 2847 } 2848 } 2914 } 2849 2915 2850 2916 done: … … 2861 2927 else 2862 2928 filelen = strlen (directory_name) + strlen (main_file_name); 2929 2863 2930 if (func == NULL) 2864 2931 funclen = 0; … … 2868 2935 if (adata (abfd).line_buf != NULL) 2869 2936 free (adata (abfd).line_buf); 2937 2870 2938 if (filelen + funclen == 0) 2871 2939 adata (abfd).line_buf = buf = NULL; … … 2875 2943 adata (abfd).line_buf = buf; 2876 2944 if (buf == NULL) 2877 return false;2945 return FALSE; 2878 2946 } 2879 2947 … … 2893 2961 { 2894 2962 const char *function = func->name; 2895 char * p;2963 char *colon; 2896 2964 2897 2965 /* The caller expects a symbol name. We actually have a … … 2905 2973 strcpy (buf + 1, function); 2906 2974 } 2907 /* Have to remove : stuff */2908 p= strchr (buf, ':');2909 if ( p!= NULL)2910 * p= '\0';2975 /* Have to remove : stuff. */ 2976 colon = strchr (buf, ':'); 2977 if (colon != NULL) 2978 *colon = '\0'; 2911 2979 *functionname_ptr = buf; 2912 2980 } 2913 2981 2914 return true;2982 return TRUE; 2915 2983 } 2916 2984 … … 2918 2986 NAME(aout,sizeof_headers) (abfd, execable) 2919 2987 bfd *abfd; 2920 b oolean execable ATTRIBUTE_UNUSED;2921 { 2922 return adata (abfd).exec_bytes_size;2988 bfd_boolean execable ATTRIBUTE_UNUSED; 2989 { 2990 return adata (abfd).exec_bytes_size; 2923 2991 } 2924 2992 … … 2926 2994 read it again later if we need it. */ 2927 2995 2928 b oolean2996 bfd_boolean 2929 2997 NAME(aout,bfd_free_cached_info) (abfd) 2930 2998 bfd *abfd; … … 2934 3002 if (bfd_get_format (abfd) != bfd_object 2935 3003 || abfd->tdata.aout_data == NULL) 2936 return true;3004 return TRUE; 2937 3005 2938 3006 #define BFCI_FREE(x) if (x != NULL) { free (x); x = NULL; } … … 2951 3019 #undef BFCI_FREE 2952 3020 2953 return true;3021 return TRUE; 2954 3022 } 2955 3023 … … 2957 3025 /* a.out link code. */ 2958 3026 2959 static b oolean aout_link_add_object_symbols3027 static bfd_boolean aout_link_add_object_symbols 2960 3028 PARAMS ((bfd *, struct bfd_link_info *)); 2961 static boolean aout_link_check_archive_element 2962 PARAMS ((bfd *, struct bfd_link_info *, boolean *)); 2963 static boolean aout_link_free_symbols PARAMS ((bfd *)); 2964 static boolean aout_link_check_ar_symbols 2965 PARAMS ((bfd *, struct bfd_link_info *, boolean *pneeded)); 2966 static boolean aout_link_add_symbols 3029 static bfd_boolean aout_link_check_archive_element 3030 PARAMS ((bfd *, struct bfd_link_info *, bfd_boolean *)); 3031 static bfd_boolean aout_link_free_symbols 3032 PARAMS ((bfd *)); 3033 static bfd_boolean aout_link_check_ar_symbols 3034 PARAMS ((bfd *, struct bfd_link_info *, bfd_boolean *pneeded)); 3035 static bfd_boolean aout_link_add_symbols 2967 3036 PARAMS ((bfd *, struct bfd_link_info *)); 2968 3037 … … 2992 3061 { 2993 3062 /* Set local fields. */ 2994 ret->written = false;3063 ret->written = FALSE; 2995 3064 ret->indx = -1; 2996 3065 } … … 3001 3070 /* Initialize an a.out link hash table. */ 3002 3071 3003 b oolean3072 bfd_boolean 3004 3073 NAME(aout,link_hash_table_init) (table, abfd, newfunc) 3005 3074 struct aout_link_hash_table *table; 3006 3075 bfd *abfd; 3007 struct bfd_hash_entry *(*newfunc) PARAMS ((struct bfd_hash_entry *,3008 3009 3076 struct bfd_hash_entry *(*newfunc) 3077 PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, 3078 const char *)); 3010 3079 { 3011 3080 return _bfd_link_hash_table_init (&table->root, abfd, newfunc); … … 3019 3088 { 3020 3089 struct aout_link_hash_table *ret; 3021 3022 ret = ((struct aout_link_hash_table *) 3023 bfd_alloc (abfd, sizeof (struct aout_link_hash_table)));3090 bfd_size_type amt = sizeof (struct aout_link_hash_table); 3091 3092 ret = (struct aout_link_hash_table *) bfd_malloc (amt); 3024 3093 if (ret == NULL) 3025 3094 return (struct bfd_link_hash_table *) NULL; 3095 3026 3096 if (! NAME(aout,link_hash_table_init) (ret, abfd, 3027 3097 NAME(aout,link_hash_newfunc))) … … 3036 3106 appropriate. */ 3037 3107 3038 b oolean3108 bfd_boolean 3039 3109 NAME(aout,link_add_symbols) (abfd, info) 3040 3110 bfd *abfd; … … 3050 3120 default: 3051 3121 bfd_set_error (bfd_error_wrong_format); 3052 return false;3122 return FALSE; 3053 3123 } 3054 3124 } … … 3056 3126 /* Add symbols from an a.out object file. */ 3057 3127 3058 static b oolean3128 static bfd_boolean 3059 3129 aout_link_add_object_symbols (abfd, info) 3060 3130 bfd *abfd; … … 3062 3132 { 3063 3133 if (! aout_get_external_symbols (abfd)) 3064 return false;3134 return FALSE; 3065 3135 if (! aout_link_add_symbols (abfd, info)) 3066 return false;3136 return FALSE; 3067 3137 if (! info->keep_memory) 3068 3138 { 3069 3139 if (! aout_link_free_symbols (abfd)) 3070 return false;3071 } 3072 return true;3140 return FALSE; 3141 } 3142 return TRUE; 3073 3143 } 3074 3144 … … 3078 3148 _bfd_generic_link_add_archive_symbols. */ 3079 3149 3080 static b oolean3150 static bfd_boolean 3081 3151 aout_link_check_archive_element (abfd, info, pneeded) 3082 3152 bfd *abfd; 3083 3153 struct bfd_link_info *info; 3084 b oolean *pneeded;3154 bfd_boolean *pneeded; 3085 3155 { 3086 3156 if (! aout_get_external_symbols (abfd)) 3087 return false;3157 return FALSE; 3088 3158 3089 3159 if (! aout_link_check_ar_symbols (abfd, info, pneeded)) 3090 return false;3160 return FALSE; 3091 3161 3092 3162 if (*pneeded) 3093 3163 { 3094 3164 if (! aout_link_add_symbols (abfd, info)) 3095 return false;3165 return FALSE; 3096 3166 } 3097 3167 … … 3099 3169 { 3100 3170 if (! aout_link_free_symbols (abfd)) 3101 return false;3102 } 3103 3104 return true;3171 return FALSE; 3172 } 3173 3174 return TRUE; 3105 3175 } 3106 3176 3107 3177 /* Free up the internal symbols read from an a.out file. */ 3108 3178 3109 static b oolean3179 static bfd_boolean 3110 3180 aout_link_free_symbols (abfd) 3111 3181 bfd *abfd; … … 3129 3199 obj_aout_external_strings (abfd) = (char *) NULL; 3130 3200 } 3131 return true;3201 return TRUE; 3132 3202 } 3133 3203 … … 3139 3209 (unless there is some other reason to include it). */ 3140 3210 3141 static b oolean3211 static bfd_boolean 3142 3212 aout_link_check_ar_symbols (abfd, info, pneeded) 3143 3213 bfd *abfd; 3144 3214 struct bfd_link_info *info; 3145 b oolean *pneeded;3215 bfd_boolean *pneeded; 3146 3216 { 3147 3217 register struct external_nlist *p; … … 3149 3219 char *strings; 3150 3220 3151 *pneeded = false;3221 *pneeded = FALSE; 3152 3222 3153 3223 /* Look through all the symbols. */ … … 3157 3227 for (; p < pend; p++) 3158 3228 { 3159 int type = bfd_h_get_8 (abfd, p->e_type);3229 int type = H_GET_8 (abfd, p->e_type); 3160 3230 const char *name; 3161 3231 struct bfd_link_hash_entry *h; … … 3179 3249 3180 3250 name = strings + GET_WORD (abfd, p->e_strx); 3181 h = bfd_link_hash_lookup (info->hash, name, false, false, true);3251 h = bfd_link_hash_lookup (info->hash, name, FALSE, FALSE, TRUE); 3182 3252 3183 3253 /* We are only interested in symbols that are currently … … 3204 3274 /* This object file defines this symbol. We must link it 3205 3275 in. This is true regardless of whether the current 3206 definition of the symbol is undefined or common. If the 3207 current definition is common, we have a case in which we 3208 have already seen an object file including 3276 definition of the symbol is undefined or common. 3277 3278 If the current definition is common, we have a case in 3279 which we have already seen an object file including: 3209 3280 int a; 3210 and this object file from the archive includes 3281 and this object file from the archive includes: 3211 3282 int a = 5; 3212 In such a case we must include this object file. 3283 In such a case, whether to include this object is target 3284 dependant for backward compatability. 3213 3285 3214 3286 FIXME: The SunOS 4.1.3 linker will pull in the archive 3215 3287 element if the symbol is defined in the .data section, 3216 3288 but not if it is defined in the .text section. That 3217 seems a bit crazy to me, and I haven't implemented it. 3218 However, it might be correct. */ 3289 seems a bit crazy to me, and it has not been implemented 3290 yet. However, it might be correct. */ 3291 if (h->type == bfd_link_hash_common) 3292 { 3293 int skip = 0; 3294 3295 switch (info->common_skip_ar_aymbols) 3296 { 3297 case bfd_link_common_skip_text: 3298 skip = (type == (N_TEXT | N_EXT)); 3299 break; 3300 case bfd_link_common_skip_data: 3301 skip = (type == (N_DATA | N_EXT)); 3302 break; 3303 default: 3304 case bfd_link_common_skip_all: 3305 skip = 1; 3306 break; 3307 } 3308 3309 if (skip) 3310 continue; 3311 } 3312 3219 3313 if (! (*info->callbacks->add_archive_element) (info, abfd, name)) 3220 return false;3221 *pneeded = true;3222 return true;3314 return FALSE; 3315 *pneeded = TRUE; 3316 return TRUE; 3223 3317 } 3224 3318 … … 3247 3341 abfd, 3248 3342 name)) 3249 return false;3250 *pneeded = true;3251 return true;3343 return FALSE; 3344 *pneeded = TRUE; 3345 return TRUE; 3252 3346 } 3253 3347 /* Turn the current link symbol into a common … … 3258 3352 sizeof (struct bfd_link_hash_common_entry))); 3259 3353 if (h->u.c.p == NULL) 3260 return false;3354 return FALSE; 3261 3355 3262 3356 h->u.c.size = value; … … 3295 3389 { 3296 3390 if (! (*info->callbacks->add_archive_element) (info, abfd, name)) 3297 return false;3298 *pneeded = true;3299 return true;3391 return FALSE; 3392 *pneeded = TRUE; 3393 return TRUE; 3300 3394 } 3301 3395 } … … 3303 3397 3304 3398 /* We do not need this object file. */ 3305 return true;3399 return TRUE; 3306 3400 } 3307 3401 3308 3402 /* Add all symbols from an object file to the hash table. */ 3309 3403 3310 static b oolean3404 static bfd_boolean 3311 3405 aout_link_add_symbols (abfd, info) 3312 3406 bfd *abfd; 3313 3407 struct bfd_link_info *info; 3314 3408 { 3315 boolean (*add_one_symbol) PARAMS ((struct bfd_link_info *, bfd *, 3316 const char *, flagword, asection *, 3317 bfd_vma, const char *, boolean, 3318 boolean, 3319 struct bfd_link_hash_entry **)); 3409 bfd_boolean (*add_one_symbol) 3410 PARAMS ((struct bfd_link_info *, bfd *, const char *, flagword, asection *, 3411 bfd_vma, const char *, bfd_boolean, bfd_boolean, 3412 struct bfd_link_hash_entry **)); 3320 3413 struct external_nlist *syms; 3321 3414 bfd_size_type sym_count; 3322 3415 char *strings; 3323 b oolean copy;3416 bfd_boolean copy; 3324 3417 struct aout_link_hash_entry **sym_hash; 3325 3418 register struct external_nlist *p; 3326 3419 struct external_nlist *pend; 3420 bfd_size_type amt; 3327 3421 3328 3422 syms = obj_aout_external_syms (abfd); … … 3330 3424 strings = obj_aout_external_strings (abfd); 3331 3425 if (info->keep_memory) 3332 copy = false;3426 copy = FALSE; 3333 3427 else 3334 copy = true;3428 copy = TRUE; 3335 3429 3336 3430 if (aout_backend_info (abfd)->add_dynamic_symbols != NULL) … … 3338 3432 if (! ((*aout_backend_info (abfd)->add_dynamic_symbols) 3339 3433 (abfd, info, &syms, &sym_count, &strings))) 3340 return false;3434 return FALSE; 3341 3435 } 3342 3436 … … 3345 3439 table, but keeping the list is more efficient. Perhaps this 3346 3440 should be conditional on info->keep_memory. */ 3347 sym_hash = ((struct aout_link_hash_entry **) 3348 bfd_alloc (abfd, 3349 ((size_t) sym_count 3350 * sizeof (struct aout_link_hash_entry *)))); 3441 amt = sym_count * sizeof (struct aout_link_hash_entry *); 3442 sym_hash = (struct aout_link_hash_entry **) bfd_alloc (abfd, amt); 3351 3443 if (sym_hash == NULL && sym_count != 0) 3352 return false;3444 return FALSE; 3353 3445 obj_aout_sym_hashes (abfd) = sym_hash; 3354 3446 … … 3370 3462 *sym_hash = NULL; 3371 3463 3372 type = bfd_h_get_8 (abfd, p->e_type);3464 type = H_GET_8 (abfd, p->e_type); 3373 3465 3374 3466 /* Ignore debugging symbols. */ … … 3507 3599 3508 3600 if (! ((*add_one_symbol) 3509 (info, abfd, name, flags, section, value, string, copy, false,3601 (info, abfd, name, flags, section, value, string, copy, FALSE, 3510 3602 (struct bfd_link_hash_entry **) sym_hash))) 3511 return false;3603 return FALSE; 3512 3604 3513 3605 /* Restrict the maximum alignment of a common symbol based on … … 3535 3627 } 3536 3628 3537 return true;3629 return TRUE; 3538 3630 } 3539 3631 … … 3566 3658 /* Look up an entry in an the header file hash table. */ 3567 3659 3568 #define aout_link_includes_lookup(table, string, create, copy) 3569 ((struct aout_link_includes_entry *) 3660 #define aout_link_includes_lookup(table, string, create, copy) \ 3661 ((struct aout_link_includes_entry *) \ 3570 3662 bfd_hash_lookup (&(table)->root, (string), (create), (copy))) 3571 3663 … … 3599 3691 static struct bfd_hash_entry *aout_link_includes_newfunc 3600 3692 PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); 3601 static b oolean aout_link_input_bfd3693 static bfd_boolean aout_link_input_bfd 3602 3694 PARAMS ((struct aout_final_link_info *, bfd *input_bfd)); 3603 static b oolean aout_link_write_symbols3695 static bfd_boolean aout_link_write_symbols 3604 3696 PARAMS ((struct aout_final_link_info *, bfd *input_bfd)); 3605 static b oolean aout_link_write_other_symbol3697 static bfd_boolean aout_link_write_other_symbol 3606 3698 PARAMS ((struct aout_link_hash_entry *, PTR)); 3607 static b oolean aout_link_input_section3699 static bfd_boolean aout_link_input_section 3608 3700 PARAMS ((struct aout_final_link_info *, bfd *input_bfd, 3609 3701 asection *input_section, file_ptr *reloff_ptr, 3610 3702 bfd_size_type rel_size)); 3611 static b oolean aout_link_input_section_std3703 static bfd_boolean aout_link_input_section_std 3612 3704 PARAMS ((struct aout_final_link_info *, bfd *input_bfd, 3613 3705 asection *input_section, struct reloc_std_external *, 3614 3706 bfd_size_type rel_size, bfd_byte *contents)); 3615 static b oolean aout_link_input_section_ext3707 static bfd_boolean aout_link_input_section_ext 3616 3708 PARAMS ((struct aout_final_link_info *, bfd *input_bfd, 3617 3709 asection *input_section, struct reloc_ext_external *, … … 3619 3711 static INLINE asection *aout_reloc_index_to_section 3620 3712 PARAMS ((bfd *, int)); 3621 static b oolean aout_link_reloc_link_order3713 static bfd_boolean aout_link_reloc_link_order 3622 3714 PARAMS ((struct aout_final_link_info *, asection *, 3623 3715 struct bfd_link_order *)); … … 3662 3754 the output section. */ 3663 3755 3664 b oolean3756 bfd_boolean 3665 3757 NAME(aout,final_link) (abfd, info, callback) 3666 3758 bfd *abfd; … … 3669 3761 { 3670 3762 struct aout_final_link_info aout_info; 3671 b oolean includes_hash_initialized = false;3763 bfd_boolean includes_hash_initialized = FALSE; 3672 3764 register bfd *sub; 3673 3765 bfd_size_type trsize, drsize; 3674 size_tmax_contents_size;3675 size_tmax_relocs_size;3676 size_tmax_sym_count;3766 bfd_size_type max_contents_size; 3767 bfd_size_type max_relocs_size; 3768 bfd_size_type max_sym_count; 3677 3769 bfd_size_type text_size; 3678 3770 file_ptr text_end; 3679 3771 register struct bfd_link_order *p; 3680 3772 asection *o; 3681 b oolean have_link_order_relocs;3773 bfd_boolean have_link_order_relocs; 3682 3774 3683 3775 if (info->shared) … … 3695 3787 251)) 3696 3788 goto error_return; 3697 includes_hash_initialized = true;3789 includes_hash_initialized = TRUE; 3698 3790 3699 3791 /* Figure out the largest section size. Also, if generating … … 3706 3798 for (sub = info->input_bfds; sub != NULL; sub = sub->link_next) 3707 3799 { 3708 size_tsz;3800 bfd_size_type sz; 3709 3801 3710 3802 if (info->relocateable) … … 3818 3910 3819 3911 h = aout_link_hash_lookup (aout_hash_table (info), "__DYNAMIC", 3820 false, false, false);3912 FALSE, FALSE, FALSE); 3821 3913 if (h != NULL) 3822 3914 aout_link_write_other_symbol (h, &aout_info); … … 3845 3937 whether we have already handled it. */ 3846 3938 for (sub = info->input_bfds; sub != (bfd *) NULL; sub = sub->link_next) 3847 sub->output_has_begun = false;3939 sub->output_has_begun = FALSE; 3848 3940 3849 3941 /* Mark all sections which are to be included in the link. This … … 3854 3946 { 3855 3947 for (p = o->link_order_head; p != NULL; p = p->next) 3856 { 3857 if (p->type == bfd_indirect_link_order) 3858 p->u.indirect.section->linker_mark = true; 3859 } 3860 } 3861 3862 have_link_order_relocs = false; 3948 if (p->type == bfd_indirect_link_order) 3949 p->u.indirect.section->linker_mark = TRUE; 3950 } 3951 3952 have_link_order_relocs = FALSE; 3863 3953 for (o = abfd->sections; o != (asection *) NULL; o = o->next) 3864 3954 { … … 3878 3968 if (! aout_link_input_bfd (&aout_info, input_bfd)) 3879 3969 goto error_return; 3880 input_bfd->output_has_begun = true;3970 input_bfd->output_has_begun = TRUE; 3881 3971 } 3882 3972 } … … 3885 3975 { 3886 3976 /* These are handled below. */ 3887 have_link_order_relocs = true;3977 have_link_order_relocs = TRUE; 3888 3978 } 3889 3979 else … … 3945 4035 { 3946 4036 bfd_hash_table_free (&aout_info.includes.root); 3947 includes_hash_initialized = false;4037 includes_hash_initialized = FALSE; 3948 4038 } 3949 4039 … … 3975 4065 { 3976 4066 bfd_byte b; 4067 file_ptr pos; 3977 4068 3978 4069 b = 0; 3979 if (bfd_seek (abfd, 3980 (obj_datasec (abfd)->filepos 3981 + exec_hdr (abfd)->a_data 3982 - 1), 3983 SEEK_SET) != 0 3984 || bfd_write (&b, 1, 1, abfd) != 1) 4070 pos = obj_datasec (abfd)->filepos + exec_hdr (abfd)->a_data - 1; 4071 if (bfd_seek (abfd, pos, SEEK_SET) != 0 4072 || bfd_bwrite (&b, (bfd_size_type) 1, abfd) != 1) 3985 4073 goto error_return; 3986 4074 } 3987 4075 3988 return true;4076 return TRUE; 3989 4077 3990 4078 error_return: … … 3999 4087 if (includes_hash_initialized) 4000 4088 bfd_hash_table_free (&aout_info.includes.root); 4001 return false;4089 return FALSE; 4002 4090 } 4003 4091 4004 4092 /* Link an a.out input BFD into the output file. */ 4005 4093 4006 static b oolean4094 static bfd_boolean 4007 4095 aout_link_input_bfd (finfo, input_bfd) 4008 4096 struct aout_final_link_info *finfo; … … 4022 4110 4023 4111 /* Get the symbols. We probably have them already, unless 4024 finfo->info->keep_memory is false. */4112 finfo->info->keep_memory is FALSE. */ 4025 4113 if (! aout_get_external_symbols (input_bfd)) 4026 return false;4114 return FALSE; 4027 4115 4028 4116 sym_count = obj_aout_external_sym_count (input_bfd); … … 4031 4119 is placed into finfo->symbol_map. */ 4032 4120 if (! aout_link_write_symbols (finfo, input_bfd)) 4033 return false;4121 return FALSE; 4034 4122 4035 4123 /* Relocate and write out the sections. These functions use the … … 4043 4131 &finfo->treloff, 4044 4132 exec_hdr (input_bfd)->a_trsize)) 4045 return false;4133 return FALSE; 4046 4134 } 4047 4135 if (obj_datasec (input_bfd)->linker_mark) … … 4051 4139 &finfo->dreloff, 4052 4140 exec_hdr (input_bfd)->a_drsize)) 4053 return false;4141 return FALSE; 4054 4142 } 4055 4143 … … 4060 4148 { 4061 4149 if (! aout_link_free_symbols (input_bfd)) 4062 return false;4063 } 4064 4065 return true;4150 return FALSE; 4151 } 4152 4153 return TRUE; 4066 4154 } 4067 4155 … … 4069 4157 symbol indices into a symbol_map. */ 4070 4158 4071 static b oolean4159 static bfd_boolean 4072 4160 aout_link_write_symbols (finfo, input_bfd) 4073 4161 struct aout_final_link_info *finfo; … … 4085 4173 struct aout_link_hash_entry **sym_hash; 4086 4174 int *symbol_map; 4087 b oolean pass;4088 b oolean skip_next;4175 bfd_boolean pass; 4176 bfd_boolean skip_next; 4089 4177 4090 4178 output_bfd = finfo->output_bfd; … … 4100 4188 && (strip != strip_some 4101 4189 || bfd_hash_lookup (finfo->info->keep_hash, input_bfd->filename, 4102 false, false) != NULL)4190 FALSE, FALSE) != NULL) 4103 4191 && discard != discard_all) 4104 4192 { 4105 bfd_h_put_8 (output_bfd, N_TEXT, outsym->e_type);4106 bfd_h_put_8 (output_bfd, 0, outsym->e_other);4107 bfd_h_put_16 (output_bfd, (bfd_vma)0, outsym->e_desc);4193 H_PUT_8 (output_bfd, N_TEXT, outsym->e_type); 4194 H_PUT_8 (output_bfd, 0, outsym->e_other); 4195 H_PUT_16 (output_bfd, 0, outsym->e_desc); 4108 4196 strtab_index = add_to_stringtab (output_bfd, finfo->strtab, 4109 input_bfd->filename, false);4197 input_bfd->filename, FALSE); 4110 4198 if (strtab_index == (bfd_size_type) -1) 4111 return false;4199 return FALSE; 4112 4200 PUT_WORD (output_bfd, strtab_index, outsym->e_strx); 4113 4201 PUT_WORD (output_bfd, … … 4120 4208 } 4121 4209 4122 pass = false;4123 skip_next = false;4210 pass = FALSE; 4211 skip_next = FALSE; 4124 4212 sym = obj_aout_external_syms (input_bfd); 4125 4213 sym_end = sym + sym_count; 4126 4214 sym_hash = obj_aout_sym_hashes (input_bfd); 4127 4215 symbol_map = finfo->symbol_map; 4128 memset (symbol_map, 0, sym_count * sizeof *symbol_map);4216 memset (symbol_map, 0, (size_t) sym_count * sizeof *symbol_map); 4129 4217 for (; sym < sym_end; sym++, sym_hash++, symbol_map++) 4130 4218 { … … 4132 4220 int type; 4133 4221 struct aout_link_hash_entry *h; 4134 b oolean skip;4222 bfd_boolean skip; 4135 4223 asection *symsec; 4136 4224 bfd_vma val = 0; 4137 b oolean copy;4225 bfd_boolean copy; 4138 4226 4139 4227 /* We set *symbol_map to 0 above for all symbols. If it has … … 4149 4237 *symbol_map = -1; 4150 4238 4151 type = bfd_h_get_8 (input_bfd, sym->e_type);4239 type = H_GET_8 (input_bfd, sym->e_type); 4152 4240 name = strings + GET_WORD (input_bfd, sym->e_strx); 4153 4241 … … 4159 4247 indirect or warning symbol. */ 4160 4248 val = GET_WORD (input_bfd, sym->e_value); 4161 pass = false;4249 pass = FALSE; 4162 4250 } 4163 4251 else if (skip_next) … … 4166 4254 symbol that we have changed to no longer be an indirect 4167 4255 symbol. */ 4168 skip_next = false;4256 skip_next = FALSE; 4169 4257 continue; 4170 4258 } … … 4181 4269 /* Use the name from the hash table, in case the symbol was 4182 4270 wrapped. */ 4183 if (h != NULL) 4271 if (h != NULL 4272 && h->root.type != bfd_link_hash_warning) 4184 4273 name = h->root.root.string; 4185 4274 … … 4203 4292 /* If the symbol has already been written out, skip it. */ 4204 4293 if (h != (struct aout_link_hash_entry *) NULL 4205 && h->root.type != bfd_link_hash_warning4206 4294 && h->written) 4207 4295 { 4208 4296 if ((type & N_TYPE) == N_INDR 4209 4297 || type == N_WARNING) 4210 skip_next = true;4298 skip_next = TRUE; 4211 4299 *symbol_map = h->indx; 4212 4300 continue; … … 4214 4302 4215 4303 /* See if we are stripping this symbol. */ 4216 skip = false;4304 skip = FALSE; 4217 4305 switch (strip) 4218 4306 { … … 4221 4309 case strip_debugger: 4222 4310 if (IS_STAB(type)) 4223 skip = true;4311 skip = TRUE; 4224 4312 break; 4225 4313 case strip_some: 4226 if (bfd_hash_lookup (finfo->info->keep_hash, name, false, false)4314 if (bfd_hash_lookup (finfo->info->keep_hash, name, FALSE, FALSE) 4227 4315 == NULL) 4228 skip = true;4316 skip = TRUE; 4229 4317 break; 4230 4318 case strip_all: 4231 skip = true;4319 skip = TRUE; 4232 4320 break; 4233 4321 } … … 4235 4323 { 4236 4324 if (h != (struct aout_link_hash_entry *) NULL) 4237 h->written = true;4325 h->written = TRUE; 4238 4326 continue; 4239 4327 } … … 4264 4352 the correct definition so the debugger will 4265 4353 understand it. */ 4266 pass = true;4354 pass = TRUE; 4267 4355 val = GET_WORD (input_bfd, sym->e_value); 4268 4356 symsec = NULL; … … 4285 4373 which is the target of the indirection. */ 4286 4374 if ((type & N_TYPE) == N_INDR) 4287 skip_next = true;4375 skip_next = TRUE; 4288 4376 4289 4377 symsec = NULL; … … 4377 4465 if (h != (struct aout_link_hash_entry *) NULL) 4378 4466 { 4379 h->written = true;4467 h->written = TRUE; 4380 4468 h->indx = obj_aout_external_sym_count (output_bfd); 4381 4469 } … … 4388 4476 { 4389 4477 case discard_none: 4478 case discard_sec_merge: 4390 4479 break; 4391 4480 case discard_l: 4392 4481 if (!IS_STAB(type) 4393 4482 && bfd_is_local_label_name (input_bfd, name)) 4394 skip = true;4483 skip = TRUE; 4395 4484 break; 4396 4485 case discard_all: 4397 skip = true;4486 skip = TRUE; 4398 4487 break; 4399 4488 } 4400 4489 if (skip) 4401 4490 { 4402 pass = false;4491 pass = FALSE; 4403 4492 continue; 4404 4493 } … … 4411 4500 numbers in types (the first number after an open 4412 4501 parenthesis). */ 4413 if (type == N_BINCL)4502 if (type == (int) N_BINCL) 4414 4503 { 4415 4504 struct external_nlist *incl_sym; … … 4424 4513 int incl_type; 4425 4514 4426 incl_type = bfd_h_get_8 (input_bfd, incl_sym->e_type);4427 if (incl_type == N_EINCL)4515 incl_type = H_GET_8 (input_bfd, incl_sym->e_type); 4516 if (incl_type == (int) N_EINCL) 4428 4517 { 4429 4518 if (nest == 0) … … 4431 4520 --nest; 4432 4521 } 4433 else if (incl_type == N_BINCL)4522 else if (incl_type == (int) N_BINCL) 4434 4523 ++nest; 4435 4524 else if (nest == 0) … … 4445 4534 /* Skip the file number. */ 4446 4535 ++s; 4447 while ( isdigit ((unsigned char)*s))4536 while (ISDIGIT (*s)) 4448 4537 ++s; 4449 4538 --s; … … 4456 4545 same value, then replace this one with an N_EXCL 4457 4546 symbol. */ 4458 copy = ! finfo->info->keep_memory;4547 copy = (bfd_boolean) (! finfo->info->keep_memory); 4459 4548 incl_entry = aout_link_includes_lookup (&finfo->includes, 4460 name, true, copy);4549 name, TRUE, copy); 4461 4550 if (incl_entry == NULL) 4462 return false;4551 return FALSE; 4463 4552 for (t = incl_entry->totals; t != NULL; t = t->next) 4464 4553 if (t->total == val) … … 4472 4561 sizeof *t)); 4473 4562 if (t == NULL) 4474 return false;4563 return FALSE; 4475 4564 t->total = val; 4476 4565 t->next = incl_entry->totals; … … 4484 4573 it to be an N_EXCL entry, and mark all the 4485 4574 included symbols to prevent outputting them. */ 4486 type = N_EXCL;4575 type = (int) N_EXCL; 4487 4576 4488 4577 nest = 0; … … 4493 4582 int incl_type; 4494 4583 4495 incl_type = bfd_h_get_8 (input_bfd, incl_sym->e_type);4496 if (incl_type == N_EINCL)4584 incl_type = H_GET_8 (input_bfd, incl_sym->e_type); 4585 if (incl_type == (int) N_EINCL) 4497 4586 { 4498 4587 if (nest == 0) … … 4503 4592 --nest; 4504 4593 } 4505 else if (incl_type == N_BINCL)4594 else if (incl_type == (int) N_BINCL) 4506 4595 ++nest; 4507 4596 else if (nest == 0) … … 4514 4603 /* Copy this symbol into the list of symbols we are going to 4515 4604 write out. */ 4516 bfd_h_put_8 (output_bfd, type, outsym->e_type); 4517 bfd_h_put_8 (output_bfd, bfd_h_get_8 (input_bfd, sym->e_other), 4518 outsym->e_other); 4519 bfd_h_put_16 (output_bfd, bfd_h_get_16 (input_bfd, sym->e_desc), 4520 outsym->e_desc); 4521 copy = false; 4605 H_PUT_8 (output_bfd, type, outsym->e_type); 4606 H_PUT_8 (output_bfd, H_GET_8 (input_bfd, sym->e_other), outsym->e_other); 4607 H_PUT_16 (output_bfd, H_GET_16 (input_bfd, sym->e_desc), outsym->e_desc); 4608 copy = FALSE; 4522 4609 if (! finfo->info->keep_memory) 4523 4610 { … … 4528 4615 name = h->root.root.string; 4529 4616 else 4530 copy = true;4617 copy = TRUE; 4531 4618 } 4532 4619 strtab_index = add_to_stringtab (output_bfd, finfo->strtab, 4533 4620 name, copy); 4534 4621 if (strtab_index == (bfd_size_type) -1) 4535 return false;4622 return FALSE; 4536 4623 PUT_WORD (output_bfd, strtab_index, outsym->e_strx); 4537 4624 PUT_WORD (output_bfd, val, outsym->e_value); … … 4544 4631 if (outsym > finfo->output_syms) 4545 4632 { 4546 bfd_size_type outsym_ count;4633 bfd_size_type outsym_size; 4547 4634 4548 4635 if (bfd_seek (output_bfd, finfo->symoff, SEEK_SET) != 0) 4549 return false; 4550 outsym_count = outsym - finfo->output_syms; 4551 if (bfd_write ((PTR) finfo->output_syms, 4552 (bfd_size_type) EXTERNAL_NLIST_SIZE, 4553 (bfd_size_type) outsym_count, output_bfd) 4554 != outsym_count * EXTERNAL_NLIST_SIZE) 4555 return false; 4556 finfo->symoff += outsym_count * EXTERNAL_NLIST_SIZE; 4557 } 4558 4559 return true; 4636 return FALSE; 4637 outsym_size = outsym - finfo->output_syms; 4638 outsym_size *= EXTERNAL_NLIST_SIZE; 4639 if (bfd_bwrite ((PTR) finfo->output_syms, outsym_size, output_bfd) 4640 != outsym_size) 4641 return FALSE; 4642 finfo->symoff += outsym_size; 4643 } 4644 4645 return TRUE; 4560 4646 } 4561 4647 … … 4563 4649 object. */ 4564 4650 4565 static b oolean4651 static bfd_boolean 4566 4652 aout_link_write_other_symbol (h, data) 4567 4653 struct aout_link_hash_entry *h; … … 4574 4660 struct external_nlist outsym; 4575 4661 bfd_size_type indx; 4662 bfd_size_type amt; 4663 4664 if (h->root.type == bfd_link_hash_warning) 4665 { 4666 h = (struct aout_link_hash_entry *) h->root.u.i.link; 4667 if (h->root.type == bfd_link_hash_new) 4668 return TRUE; 4669 } 4576 4670 4577 4671 output_bfd = finfo->output_bfd; … … 4588 4682 4589 4683 if (h->written) 4590 return true;4591 4592 h->written = true;4684 return TRUE; 4685 4686 h->written = TRUE; 4593 4687 4594 4688 /* An indx of -2 means the symbol must be written. */ … … 4597 4691 || (finfo->info->strip == strip_some 4598 4692 && bfd_hash_lookup (finfo->info->keep_hash, h->root.root.string, 4599 false, false) == NULL)))4600 return true;4693 FALSE, FALSE) == NULL))) 4694 return TRUE; 4601 4695 4602 4696 switch (h->root.type) 4603 4697 { 4604 4698 default: 4699 case bfd_link_hash_warning: 4605 4700 abort (); 4606 4701 /* Avoid variable not initialized warnings. */ 4607 return true;4702 return TRUE; 4608 4703 case bfd_link_hash_new: 4609 4704 /* This can happen for set symbols when sets are not being 4610 4705 built. */ 4611 return true;4706 return TRUE; 4612 4707 case bfd_link_hash_undefined: 4613 4708 type = N_UNDF | N_EXT; … … 4644 4739 val = 0; 4645 4740 case bfd_link_hash_indirect: 4646 case bfd_link_hash_warning: 4647 /* FIXME: Ignore these for now. The circumstances under which 4648 they should be written out are not clear to me. */ 4649 return true; 4650 } 4651 4652 bfd_h_put_8 (output_bfd, type, outsym.e_type); 4653 bfd_h_put_8 (output_bfd, 0, outsym.e_other); 4654 bfd_h_put_16 (output_bfd, 0, outsym.e_desc); 4741 /* We ignore these symbols, since the indirected symbol is 4742 already in the hash table. */ 4743 return TRUE; 4744 } 4745 4746 H_PUT_8 (output_bfd, type, outsym.e_type); 4747 H_PUT_8 (output_bfd, 0, outsym.e_other); 4748 H_PUT_16 (output_bfd, 0, outsym.e_desc); 4655 4749 indx = add_to_stringtab (output_bfd, finfo->strtab, h->root.root.string, 4656 false);4657 if (indx == (bfd_size_type) -1)4750 FALSE); 4751 if (indx == - (bfd_size_type) 1) 4658 4752 { 4659 4753 /* FIXME: No way to handle errors. */ … … 4663 4757 PUT_WORD (output_bfd, val, outsym.e_value); 4664 4758 4759 amt = EXTERNAL_NLIST_SIZE; 4665 4760 if (bfd_seek (output_bfd, finfo->symoff, SEEK_SET) != 0 4666 || bfd_write ((PTR) &outsym, (bfd_size_type) EXTERNAL_NLIST_SIZE, 4667 (bfd_size_type) 1, output_bfd) != EXTERNAL_NLIST_SIZE) 4761 || bfd_bwrite ((PTR) &outsym, amt, output_bfd) != amt) 4668 4762 { 4669 4763 /* FIXME: No way to handle errors. */ … … 4675 4769 ++obj_aout_external_sym_count (output_bfd); 4676 4770 4677 return true;4771 return TRUE; 4678 4772 } 4679 4773 4680 4774 /* Link an a.out section into the output file. */ 4681 4775 4682 static b oolean4776 static bfd_boolean 4683 4777 aout_link_input_section (finfo, input_bfd, input_section, reloff_ptr, 4684 4778 rel_size) … … 4697 4791 (PTR) finfo->contents, 4698 4792 (file_ptr) 0, input_size)) 4699 return false;4793 return FALSE; 4700 4794 4701 4795 /* Read in the relocs if we haven't already done it. */ … … 4709 4803 { 4710 4804 if (bfd_seek (input_bfd, input_section->rel_filepos, SEEK_SET) != 0 4711 || bfd_ read (relocs, 1, rel_size, input_bfd) != rel_size)4712 return false;4805 || bfd_bread (relocs, rel_size, input_bfd) != rel_size) 4806 return FALSE; 4713 4807 } 4714 4808 } … … 4720 4814 (struct reloc_std_external *) relocs, 4721 4815 rel_size, finfo->contents)) 4722 return false;4816 return FALSE; 4723 4817 } 4724 4818 else … … 4727 4821 (struct reloc_ext_external *) relocs, 4728 4822 rel_size, finfo->contents)) 4729 return false;4823 return FALSE; 4730 4824 } 4731 4825 … … 4734 4828 input_section->output_section, 4735 4829 (PTR) finfo->contents, 4736 input_section->output_offset,4830 (file_ptr) input_section->output_offset, 4737 4831 input_size)) 4738 return false;4832 return FALSE; 4739 4833 4740 4834 /* If we are producing relocateable output, the relocs were … … 4743 4837 { 4744 4838 if (bfd_seek (finfo->output_bfd, *reloff_ptr, SEEK_SET) != 0) 4745 return false; 4746 if (bfd_write (relocs, (bfd_size_type) 1, rel_size, finfo->output_bfd) 4747 != rel_size) 4748 return false; 4839 return FALSE; 4840 if (bfd_bwrite (relocs, rel_size, finfo->output_bfd) != rel_size) 4841 return FALSE; 4749 4842 *reloff_ptr += rel_size; 4750 4843 … … 4758 4851 } 4759 4852 4760 return true;4853 return TRUE; 4761 4854 } 4762 4855 … … 4788 4881 /* Relocate an a.out section using standard a.out relocs. */ 4789 4882 4790 static b oolean4883 static bfd_boolean 4791 4884 aout_link_input_section_std (finfo, input_bfd, input_section, relocs, 4792 4885 rel_size, contents) … … 4798 4891 bfd_byte *contents; 4799 4892 { 4800 boolean (*check_dynamic_reloc) PARAMS ((struct bfd_link_info *, 4801 bfd *, asection *, 4802 struct aout_link_hash_entry *, 4803 PTR, bfd_byte *, boolean *, 4804 bfd_vma *)); 4893 bfd_boolean (*check_dynamic_reloc) 4894 PARAMS ((struct bfd_link_info *, bfd *, asection *, 4895 struct aout_link_hash_entry *, PTR, bfd_byte *, bfd_boolean *, 4896 bfd_vma *)); 4805 4897 bfd *output_bfd; 4806 b oolean relocateable;4898 bfd_boolean relocateable; 4807 4899 struct external_nlist *syms; 4808 4900 char *strings; … … 4844 4936 4845 4937 #ifdef MY_reloc_howto 4846 howto = MY_reloc_howto (input_bfd, rel, r_index, r_extern, r_pcrel);4938 howto = MY_reloc_howto (input_bfd, rel, r_index, r_extern, r_pcrel); 4847 4939 #else 4848 4940 { … … 4854 4946 if (bfd_header_big_endian (input_bfd)) 4855 4947 { 4856 r_index = (( rel->r_index[0] << 16)4857 | ( rel->r_index[1] << 8)4948 r_index = (((unsigned int) rel->r_index[0] << 16) 4949 | ((unsigned int) rel->r_index[1] << 8) 4858 4950 | rel->r_index[2]); 4859 4951 r_extern = (0 != (rel->r_type[0] & RELOC_STD_BITS_EXTERN_BIG)); … … 4867 4959 else 4868 4960 { 4869 r_index = (( rel->r_index[2] << 16)4870 | ( rel->r_index[1] << 8)4961 r_index = (((unsigned int) rel->r_index[2] << 16) 4962 | ((unsigned int) rel->r_index[1] << 8) 4871 4963 | rel->r_index[0]); 4872 4964 r_extern = (0 != (rel->r_type[0] & RELOC_STD_BITS_EXTERN_LITTLE)); … … 4951 5043 { 4952 5044 h->indx = -2; 4953 h->written = false;5045 h->written = FALSE; 4954 5046 if (! aout_link_write_other_symbol (h, 4955 5047 (PTR) finfo)) 4956 return false;5048 return FALSE; 4957 5049 } 4958 5050 r_index = h->indx; … … 4967 5059 (finfo->info, name, input_bfd, input_section, 4968 5060 r_addr))) 4969 return false;5061 return FALSE; 4970 5062 r_index = 0; 4971 5063 } … … 5027 5119 else 5028 5120 { 5029 b oolean hundef;5121 bfd_boolean hundef; 5030 5122 5031 5123 /* We are generating an executable, and must do a full 5032 5124 relocation. */ 5033 hundef = false;5125 hundef = FALSE; 5034 5126 5035 5127 if (r_extern) … … 5050 5142 else 5051 5143 { 5052 hundef = true;5144 hundef = TRUE; 5053 5145 relocation = 0; 5054 5146 } … … 5068 5160 if (check_dynamic_reloc != NULL) 5069 5161 { 5070 b oolean skip;5162 bfd_boolean skip; 5071 5163 5072 5164 if (! ((*check_dynamic_reloc) 5073 5165 (finfo->info, input_bfd, input_section, h, 5074 5166 (PTR) rel, contents, &skip, &relocation))) 5075 return false;5167 return FALSE; 5076 5168 if (skip) 5077 5169 continue; … … 5091 5183 if (! ((*finfo->info->callbacks->undefined_symbol) 5092 5184 (finfo->info, name, input_bfd, input_section, 5093 r_addr, true)))5094 return false;5185 r_addr, TRUE))) 5186 return FALSE; 5095 5187 } 5096 5188 … … 5127 5219 (finfo->info, name, howto->name, 5128 5220 (bfd_vma) 0, input_bfd, input_section, r_addr))) 5129 return false;5221 return FALSE; 5130 5222 } 5131 5223 break; … … 5134 5226 } 5135 5227 5136 return true;5228 return TRUE; 5137 5229 } 5138 5230 5139 5231 /* Relocate an a.out section using extended a.out relocs. */ 5140 5232 5141 static b oolean5233 static bfd_boolean 5142 5234 aout_link_input_section_ext (finfo, input_bfd, input_section, relocs, 5143 5235 rel_size, contents) … … 5149 5241 bfd_byte *contents; 5150 5242 { 5151 boolean (*check_dynamic_reloc) PARAMS ((struct bfd_link_info *, 5152 bfd *, asection *, 5153 struct aout_link_hash_entry *, 5154 PTR, bfd_byte *, boolean *, 5155 bfd_vma *)); 5243 bfd_boolean (*check_dynamic_reloc) 5244 PARAMS ((struct bfd_link_info *, bfd *, asection *, 5245 struct aout_link_hash_entry *, PTR, bfd_byte *, bfd_boolean *, 5246 bfd_vma *)); 5156 5247 bfd *output_bfd; 5157 b oolean relocateable;5248 bfd_boolean relocateable; 5158 5249 struct external_nlist *syms; 5159 5250 char *strings; … … 5195 5286 if (bfd_header_big_endian (input_bfd)) 5196 5287 { 5197 r_index = (( rel->r_index[0] << 16)5198 | ( rel->r_index[1] << 8)5288 r_index = (((unsigned int) rel->r_index[0] << 16) 5289 | ((unsigned int) rel->r_index[1] << 8) 5199 5290 | rel->r_index[2]); 5200 5291 r_extern = (0 != (rel->r_type[0] & RELOC_EXT_BITS_EXTERN_BIG)); … … 5204 5295 else 5205 5296 { 5206 r_index = (( rel->r_index[2] << 16)5207 | ( rel->r_index[1] << 8)5297 r_index = (((unsigned int) rel->r_index[2] << 16) 5298 | ((unsigned int) rel->r_index[1] << 8) 5208 5299 | rel->r_index[0]); 5209 5300 r_extern = (0 != (rel->r_type[0] & RELOC_EXT_BITS_EXTERN_LITTLE)); … … 5221 5312 modify the reloc accordingly. */ 5222 5313 if (r_extern 5223 || r_type == RELOC_BASE105224 || r_type == RELOC_BASE135225 || r_type == RELOC_BASE22)5314 || r_type == (unsigned int) RELOC_BASE10 5315 || r_type == (unsigned int) RELOC_BASE13 5316 || r_type == (unsigned int) RELOC_BASE22) 5226 5317 { 5227 5318 /* If we know the symbol this relocation is against, 5228 5319 convert it into a relocation against a section. This 5229 5320 is what the native linker does. */ 5230 if (r_type == RELOC_BASE105231 || r_type == RELOC_BASE135232 || r_type == RELOC_BASE22)5321 if (r_type == (unsigned int) RELOC_BASE10 5322 || r_type == (unsigned int) RELOC_BASE13 5323 || r_type == (unsigned int) RELOC_BASE22) 5233 5324 h = NULL; 5234 5325 else … … 5289 5380 { 5290 5381 h->indx = -2; 5291 h->written = false;5382 h->written = FALSE; 5292 5383 if (! aout_link_write_other_symbol (h, 5293 5384 (PTR) finfo)) 5294 return false;5385 return FALSE; 5295 5386 } 5296 5387 r_index = h->indx; … … 5305 5396 (finfo->info, name, input_bfd, input_section, 5306 5397 r_addr))) 5307 return false;5398 return FALSE; 5308 5399 r_index = 0; 5309 5400 } … … 5370 5461 else 5371 5462 { 5372 b oolean hundef;5463 bfd_boolean hundef; 5373 5464 bfd_reloc_status_type r; 5374 5465 5375 5466 /* We are generating an executable, and must do a full 5376 5467 relocation. */ 5377 hundef = false;5468 hundef = FALSE; 5378 5469 5379 5470 if (r_extern) … … 5394 5485 else 5395 5486 { 5396 hundef = true;5487 hundef = TRUE; 5397 5488 relocation = 0; 5398 5489 } 5399 5490 } 5400 else if (r_type == RELOC_BASE105401 || r_type == RELOC_BASE135402 || r_type == RELOC_BASE22)5491 else if (r_type == (unsigned int) RELOC_BASE10 5492 || r_type == (unsigned int) RELOC_BASE13 5493 || r_type == (unsigned int) RELOC_BASE22) 5403 5494 { 5404 5495 struct external_nlist *sym; … … 5408 5499 into the symbol table, even if r_extern is 0. */ 5409 5500 sym = syms + r_index; 5410 type = bfd_h_get_8 (input_bfd, sym->e_type);5501 type = H_GET_8 (input_bfd, sym->e_type); 5411 5502 if ((type & N_TYPE) == N_TEXT 5412 5503 || type == N_WEAKT) … … 5467 5558 if (check_dynamic_reloc != NULL) 5468 5559 { 5469 b oolean skip;5560 bfd_boolean skip; 5470 5561 5471 5562 if (! ((*check_dynamic_reloc) 5472 5563 (finfo->info, input_bfd, input_section, h, 5473 5564 (PTR) rel, contents, &skip, &relocation))) 5474 return false;5565 return FALSE; 5475 5566 if (skip) 5476 5567 continue; … … 5482 5573 if (hundef 5483 5574 && ! finfo->info->shared 5484 && r_type != RELOC_BASE105485 && r_type != RELOC_BASE135486 && r_type != RELOC_BASE22)5575 && r_type != (unsigned int) RELOC_BASE10 5576 && r_type != (unsigned int) RELOC_BASE13 5577 && r_type != (unsigned int) RELOC_BASE22) 5487 5578 { 5488 5579 const char *name; … … 5494 5585 if (! ((*finfo->info->callbacks->undefined_symbol) 5495 5586 (finfo->info, name, input_bfd, input_section, 5496 r_addr, true)))5497 return false;5587 r_addr, TRUE))) 5588 return FALSE; 5498 5589 } 5499 5590 5500 if (r_type != RELOC_SPARC_REV32)5591 if (r_type != (unsigned int) RELOC_SPARC_REV32) 5501 5592 r = MY_final_link_relocate (howto_table_ext + r_type, 5502 5593 input_bfd, input_section, … … 5527 5618 name = h->root.root.string; 5528 5619 else if (r_extern 5529 || r_type == RELOC_BASE105530 || r_type == RELOC_BASE135531 || r_type == RELOC_BASE22)5620 || r_type == (unsigned int) RELOC_BASE10 5621 || r_type == (unsigned int) RELOC_BASE13 5622 || r_type == (unsigned int) RELOC_BASE22) 5532 5623 name = strings + GET_WORD (input_bfd, 5533 5624 syms[r_index].e_strx); … … 5542 5633 (finfo->info, name, howto_table_ext[r_type].name, 5543 5634 r_addend, input_bfd, input_section, r_addr))) 5544 return false;5635 return FALSE; 5545 5636 } 5546 5637 break; … … 5550 5641 } 5551 5642 5552 return true;5643 return TRUE; 5553 5644 } 5554 5645 5555 5646 /* Handle a link order which is supposed to generate a reloc. */ 5556 5647 5557 static b oolean5648 static bfd_boolean 5558 5649 aout_link_reloc_link_order (finfo, o, p) 5559 5650 struct aout_final_link_info *finfo; … … 5569 5660 struct reloc_ext_external erel; 5570 5661 PTR rel_ptr; 5662 bfd_size_type amt; 5571 5663 5572 5664 pr = p->u.reloc.p; … … 5591 5683 h = ((struct aout_link_hash_entry *) 5592 5684 bfd_wrapped_link_hash_lookup (finfo->output_bfd, finfo->info, 5593 pr->u.name, false, false, true));5685 pr->u.name, FALSE, FALSE, TRUE)); 5594 5686 if (h != (struct aout_link_hash_entry *) NULL 5595 5687 && h->indx >= 0) … … 5602 5694 symbol. */ 5603 5695 h->indx = -2; 5604 h->written = false;5696 h->written = FALSE; 5605 5697 if (! aout_link_write_other_symbol (h, (PTR) finfo)) 5606 return false;5698 return FALSE; 5607 5699 r_index = h->indx; 5608 5700 } … … 5612 5704 (finfo->info, pr->u.name, (bfd *) NULL, 5613 5705 (asection *) NULL, (bfd_vma) 0))) 5614 return false;5706 return FALSE; 5615 5707 r_index = 0; 5616 5708 } … … 5621 5713 { 5622 5714 bfd_set_error (bfd_error_bad_value); 5623 return false;5715 return FALSE; 5624 5716 } 5625 5717 … … 5634 5726 { 5635 5727 #ifdef MY_put_reloc 5636 MY_put_reloc (finfo->output_bfd, r_extern, r_index, p->offset, howto,5637 &srel);5728 MY_put_reloc (finfo->output_bfd, r_extern, r_index, p->offset, howto, 5729 &srel); 5638 5730 #else 5639 5731 { … … 5644 5736 int r_length; 5645 5737 5646 r_pcrel = howto->pc_relative;5738 r_pcrel = (int) howto->pc_relative; 5647 5739 r_baserel = (howto->type & 8) != 0; 5648 5740 r_jmptable = (howto->type & 16) != 0; … … 5691 5783 bfd_reloc_status_type r; 5692 5784 bfd_byte *buf; 5693 b oolean ok;5785 bfd_boolean ok; 5694 5786 5695 5787 size = bfd_get_reloc_size (howto); 5696 5788 buf = (bfd_byte *) bfd_zmalloc (size); 5697 5789 if (buf == (bfd_byte *) NULL) 5698 return false;5790 return FALSE; 5699 5791 r = MY_relocate_contents (howto, finfo->output_bfd, 5700 5792 (bfd_vma) pr->addend, buf); 5701 5793 switch (r) 5702 5794 { … … 5717 5809 { 5718 5810 free (buf); 5719 return false;5811 return FALSE; 5720 5812 } 5721 5813 break; 5722 5814 } 5723 ok = bfd_set_section_contents (finfo->output_bfd, o, 5724 (PTR) buf, 5725 (file_ptr) p->offset, 5726 size); 5815 ok = bfd_set_section_contents (finfo->output_bfd, o, (PTR) buf, 5816 (file_ptr) p->offset, size); 5727 5817 free (buf); 5728 5818 if (! ok) 5729 return false;5819 return FALSE; 5730 5820 } 5731 5821 } … … 5757 5847 } 5758 5848 5759 PUT_WORD (finfo->output_bfd, pr->addend, erel.r_addend);5849 PUT_WORD (finfo->output_bfd, (bfd_vma) pr->addend, erel.r_addend); 5760 5850 #endif /* MY_put_ext_reloc */ 5761 5851 … … 5763 5853 } 5764 5854 5855 amt = obj_reloc_entry_size (finfo->output_bfd); 5765 5856 if (bfd_seek (finfo->output_bfd, *reloff_ptr, SEEK_SET) != 0 5766 || (bfd_write (rel_ptr, (bfd_size_type) 1, 5767 obj_reloc_entry_size (finfo->output_bfd), 5768 finfo->output_bfd) 5769 != obj_reloc_entry_size (finfo->output_bfd))) 5770 return false; 5857 || bfd_bwrite (rel_ptr, amt, finfo->output_bfd) != amt) 5858 return FALSE; 5771 5859 5772 5860 *reloff_ptr += obj_reloc_entry_size (finfo->output_bfd); … … 5779 5867 <= obj_datasec (finfo->output_bfd)->rel_filepos))); 5780 5868 5781 return true;5782 } 5869 return TRUE; 5870 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/binutils/bfd/archive.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r617 r618 1 1 /* BFD back-end for archive files (libraries). 2 2 Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 3 2000 3 2000, 2001, 2002 4 4 Free Software Foundation, Inc. 5 5 Written by Cygnus Support. Mostly Gumby Henkel-Wallace's fault. … … 133 133 #include "aout/ar.h" 134 134 #include "aout/ranlib.h" 135 #include <ctype.h>135 #include "safe-ctype.h" 136 136 137 137 #ifndef errno … … 141 141 #ifdef GNU960 142 142 #define BFD_GNU960_ARMAG(abfd) (BFD_COFF_FILE_P((abfd)) ? ARMAG : ARMAGB) 143 #endif144 145 /* Define offsetof for those systems which lack it */146 147 #ifndef offsetof148 #define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER)149 143 #endif 150 144 … … 167 161 #define arch_hdr(bfd) ((struct ar_hdr *)arch_eltdata(bfd)->arch_header) 168 162 169 static char *get_extended_arelt_filename PARAMS ((bfd *arch, 170 const char *name)); 171 static boolean do_slurp_bsd_armap PARAMS ((bfd *abfd)); 172 static boolean do_slurp_coff_armap PARAMS ((bfd *abfd)); 173 static const char *normalize PARAMS ((bfd *, const char *file)); 174 static struct areltdata *bfd_ar_hdr_from_filesystem PARAMS ((bfd *abfd, 175 const char *, 176 bfd *member)); 177 178 179 boolean 163 static char *get_extended_arelt_filename 164 PARAMS ((bfd *arch, const char *name)); 165 static bfd_boolean do_slurp_bsd_armap 166 PARAMS ((bfd *abfd)); 167 static bfd_boolean do_slurp_coff_armap 168 PARAMS ((bfd *abfd)); 169 bfd_boolean bfd_elf64_archive_slurp_armap 170 PARAMS ((bfd *abfd)); 171 static const char *normalize 172 PARAMS ((bfd *, const char *file)); 173 static struct areltdata *bfd_ar_hdr_from_filesystem 174 PARAMS ((bfd *abfd, const char *, bfd *member)); 175 176 177 bfd_boolean 180 178 _bfd_generic_mkarchive (abfd) 181 179 bfd *abfd; 182 180 { 183 abfd->tdata.aout_ar_data = ((struct artdata *)184 bfd_zalloc (abfd, sizeof (struct artdata))); 185 181 bfd_size_type amt = sizeof (struct artdata); 182 183 abfd->tdata.aout_ar_data = (struct artdata *) bfd_zalloc (abfd, amt); 186 184 if (bfd_ardata (abfd) == NULL) 187 return false;185 return FALSE; 188 186 189 187 bfd_ardata (abfd)->cache = NULL; … … 193 191 bfd_ardata (abfd)->tdata = NULL; 194 192 195 return true;193 return TRUE; 196 194 } 197 195 … … 254 252 255 253 SYNOPSIS 256 b oolean bfd_set_archive_head(bfd *output, bfd *new_head);254 bfd_boolean bfd_set_archive_head(bfd *output, bfd *new_head); 257 255 258 256 DESCRIPTION … … 261 259 */ 262 260 263 b oolean261 bfd_boolean 264 262 bfd_set_archive_head (output_archive, new_head) 265 263 bfd *output_archive; … … 268 266 269 267 output_archive->archive_head = new_head; 270 return true;268 return TRUE; 271 269 } 272 270 … … 287 285 288 286 /* Kind of stupid to call cons for each one, but we don't do too many */ 289 b oolean287 bfd_boolean 290 288 _bfd_add_bfd_to_archive_cache (arch_bfd, filepos, new_elt) 291 289 bfd *arch_bfd, *new_elt; 292 290 file_ptr filepos; 293 291 { 294 struct ar_cache *new_cache = ((struct ar_cache *) 295 bfd_zalloc (arch_bfd, 296 sizeof (struct ar_cache))); 297 292 bfd_size_type amt = sizeof (struct ar_cache); 293 294 struct ar_cache *new_cache = (struct ar_cache *) bfd_zalloc (arch_bfd, amt); 298 295 if (new_cache == NULL) 299 return false;296 return FALSE; 300 297 301 298 new_cache->ptr = filepos; … … 313 310 } 314 311 315 return true;312 return TRUE; 316 313 } 317 314 … … 367 364 struct ar_hdr hdr; 368 365 char *hdrp = (char *) &hdr; 369 unsigned int parsed_size;366 size_t parsed_size; 370 367 struct areltdata *ared; 371 368 char *filename = NULL; 372 unsigned intnamelen = 0;373 unsigned intallocsize = sizeof (struct areltdata) + sizeof (struct ar_hdr);369 bfd_size_type namelen = 0; 370 bfd_size_type allocsize = sizeof (struct areltdata) + sizeof (struct ar_hdr); 374 371 char *allocptr = 0; 375 372 376 if (bfd_ read ((PTR) hdrp, 1,sizeof (struct ar_hdr), abfd)373 if (bfd_bread ((PTR) hdrp, (bfd_size_type) sizeof (struct ar_hdr), abfd) 377 374 != sizeof (struct ar_hdr)) 378 375 { … … 417 414 && hdr.ar_name[1] == '1' 418 415 && hdr.ar_name[2] == '/' 419 && isdigit ((unsigned char)hdr.ar_name[3]))416 && ISDIGIT (hdr.ar_name[3])) 420 417 { 421 418 /* BSD-4.4 extended name */ … … 430 427 + sizeof (struct areltdata) 431 428 + sizeof (struct ar_hdr)); 432 if (bfd_ read (filename, 1, namelen, abfd) != namelen)429 if (bfd_bread (filename, namelen, abfd) != namelen) 433 430 { 434 431 if (bfd_get_error () != bfd_error_system_call) … … 445 442 446 443 char *e; 447 e = memchr (hdr.ar_name, '\0', ar_maxnamelen (abfd));444 e = (char *) memchr (hdr.ar_name, '\0', ar_maxnamelen (abfd)); 448 445 if (e == NULL) 449 446 { 450 e = memchr (hdr.ar_name, '/', ar_maxnamelen (abfd));447 e = (char *) memchr (hdr.ar_name, '/', ar_maxnamelen (abfd)); 451 448 if (e == NULL) 452 e = memchr (hdr.ar_name, ' ', ar_maxnamelen (abfd));449 e = (char *) memchr (hdr.ar_name, ' ', ar_maxnamelen (abfd)); 453 450 } 454 451 … … 485 482 sizeof (struct ar_hdr)); 486 483 if (namelen) 487 memcpy (ared->filename, hdr.ar_name, namelen);484 memcpy (ared->filename, hdr.ar_name, (size_t) namelen); 488 485 ared->filename[namelen] = '\0'; 489 486 } … … 611 608 struct artdata *tdata_hold; 612 609 char armag[SARMAG + 1]; 613 614 tdata_hold = abfd->tdata.aout_ar_data; 615 616 if (bfd_read ((PTR) armag, 1, SARMAG, abfd) != SARMAG) 610 bfd_size_type amt; 611 612 if (bfd_bread ((PTR) armag, (bfd_size_type) SARMAG, abfd) != SARMAG) 617 613 { 618 614 if (bfd_get_error () != bfd_error_system_call) … … 630 626 #endif 631 627 632 /* We are setting bfd_ardata(abfd) here, but since bfd_ardata 633 involves a cast, we can't do it as the left operand of assignment. */ 634 abfd->tdata.aout_ar_data = ((struct artdata *) 635 bfd_zalloc (abfd, sizeof (struct artdata))); 636 628 tdata_hold = bfd_ardata (abfd); 629 630 amt = sizeof (struct artdata); 631 bfd_ardata (abfd) = (struct artdata *) bfd_zalloc (abfd, amt); 637 632 if (bfd_ardata (abfd) == NULL) 638 return NULL; 633 { 634 bfd_ardata (abfd) = tdata_hold; 635 return NULL; 636 } 639 637 640 638 bfd_ardata (abfd)->first_file_filepos = SARMAG; … … 645 643 bfd_ardata (abfd)->tdata = NULL; 646 644 647 if (!BFD_SEND (abfd, _bfd_slurp_armap, (abfd))) 648 { 649 bfd_release (abfd, bfd_ardata (abfd)); 650 abfd->tdata.aout_ar_data = tdata_hold; 645 if (!BFD_SEND (abfd, _bfd_slurp_armap, (abfd)) 646 || !BFD_SEND (abfd, _bfd_slurp_extended_name_table, (abfd))) 647 { 651 648 if (bfd_get_error () != bfd_error_system_call) 652 649 bfd_set_error (bfd_error_wrong_format); 653 return NULL;654 }655 656 if (!BFD_SEND (abfd, _bfd_slurp_extended_name_table, (abfd)))657 {658 650 bfd_release (abfd, bfd_ardata (abfd)); 659 abfd->tdata.aout_ar_data = tdata_hold; 660 if (bfd_get_error () != bfd_error_system_call) 661 bfd_set_error (bfd_error_wrong_format); 651 bfd_ardata (abfd) = tdata_hold; 662 652 return NULL; 663 653 } … … 681 671 if (first != NULL) 682 672 { 683 b oolean fail;684 685 first->target_defaulted = false;686 fail = false;673 bfd_boolean fail; 674 675 first->target_defaulted = FALSE; 676 fail = FALSE; 687 677 if (bfd_check_format (first, bfd_object) 688 678 && first->xvec != abfd->xvec) 689 679 { 680 #if 0 681 /* We ought to close `first' here, but we can't, because 682 we have no way to remove it from the archive cache. 683 It's close to impossible to figure out when we can 684 release bfd_ardata. FIXME. */ 690 685 (void) bfd_close (first); 691 686 bfd_release (abfd, bfd_ardata (abfd)); 692 abfd->tdata.aout_ar_data = tdata_hold; 693 bfd_set_error (bfd_error_wrong_format); 687 #endif 688 bfd_set_error (bfd_error_wrong_object_format); 689 bfd_ardata (abfd) = tdata_hold; 694 690 return NULL; 695 691 } 696 697 /* We ought to close first here, but we can't, because we 698 have no way to remove it from the archive cache. FIXME. */ 692 /* And we ought to close `first' here too. */ 699 693 } 700 694 } … … 706 700 support 64 bit archives presently; so far as I know, none actually 707 701 exist. Supporting them would require changing these constants, and 708 changing some bfd_h_get_32 to bfd_h_get_64. */702 changing some H_GET_32 to H_GET_64. */ 709 703 710 704 /* The size of an external symdef structure. */ … … 720 714 #define BSD_STRING_COUNT_SIZE 4 721 715 722 /* Returns false on error, trueotherwise */723 724 static b oolean716 /* Returns FALSE on error, TRUE otherwise */ 717 718 static bfd_boolean 725 719 do_slurp_bsd_armap (abfd) 726 720 bfd *abfd; … … 731 725 struct artdata *ardata = bfd_ardata (abfd); 732 726 char *stringbase; 733 unsigned int parsed_size;727 bfd_size_type parsed_size, amt; 734 728 carsym *set; 735 729 736 730 mapdata = (struct areltdata *) _bfd_read_ar_hdr (abfd); 737 731 if (mapdata == NULL) 738 return false;732 return FALSE; 739 733 parsed_size = mapdata->parsed_size; 740 734 bfd_release (abfd, (PTR) mapdata); /* Don't need it any more. */ … … 742 736 raw_armap = (bfd_byte *) bfd_zalloc (abfd, parsed_size); 743 737 if (raw_armap == (bfd_byte *) NULL) 744 return false;745 746 if (bfd_ read ((PTR) raw_armap, 1, parsed_size, abfd) != parsed_size)738 return FALSE; 739 740 if (bfd_bread ((PTR) raw_armap, parsed_size, abfd) != parsed_size) 747 741 { 748 742 if (bfd_get_error () != bfd_error_system_call) … … 750 744 byebye: 751 745 bfd_release (abfd, (PTR) raw_armap); 752 return false;753 } 754 755 ardata->symdef_count = bfd_h_get_32 (abfd, raw_armap) / BSD_SYMDEF_SIZE;746 return FALSE; 747 } 748 749 ardata->symdef_count = H_GET_32 (abfd, raw_armap) / BSD_SYMDEF_SIZE; 756 750 757 751 if (ardata->symdef_count * BSD_SYMDEF_SIZE > … … 768 762 + ardata->symdef_count * BSD_SYMDEF_SIZE 769 763 + BSD_STRING_COUNT_SIZE); 770 ardata->symdefs = (carsym *) bfd_alloc (abfd, 771 (ardata->symdef_count 772 * sizeof (carsym))); 764 amt = (bfd_size_type) ardata->symdef_count * sizeof (carsym); 765 ardata->symdefs = (carsym *) bfd_alloc (abfd, amt); 773 766 if (!ardata->symdefs) 774 return false;767 return FALSE; 775 768 776 769 for (counter = 0, set = ardata->symdefs; … … 778 771 counter++, set++, rbase += BSD_SYMDEF_SIZE) 779 772 { 780 set->name = bfd_h_get_32 (abfd, rbase) + stringbase;781 set->file_offset = bfd_h_get_32 (abfd, rbase + BSD_SYMDEF_OFFSET_SIZE);773 set->name = H_GET_32 (abfd, rbase) + stringbase; 774 set->file_offset = H_GET_32 (abfd, rbase + BSD_SYMDEF_OFFSET_SIZE); 782 775 } 783 776 … … 788 781 we are done using the strings from it. For now, it seems 789 782 to be allocated on an objalloc anyway... */ 790 bfd_has_map (abfd) = true;791 return true;792 } 793 794 /* Returns false on error, trueotherwise. */795 796 static b oolean783 bfd_has_map (abfd) = TRUE; 784 return TRUE; 785 } 786 787 /* Returns FALSE on error, TRUE otherwise. */ 788 789 static bfd_boolean 797 790 do_slurp_coff_armap (abfd) 798 791 bfd *abfd; … … 802 795 struct artdata *ardata = bfd_ardata (abfd); 803 796 char *stringbase; 804 unsigned intstringsize;797 bfd_size_type stringsize; 805 798 unsigned int parsed_size; 806 799 carsym *carsyms; 807 unsigned intnsymz; /* Number of symbols in armap. */800 bfd_size_type nsymz; /* Number of symbols in armap. */ 808 801 bfd_vma (*swap) PARAMS ((const bfd_byte *)); 809 802 char int_buf[sizeof (long)]; 810 unsigned int carsym_size, ptrsize, i; 803 bfd_size_type carsym_size, ptrsize; 804 unsigned int i; 811 805 812 806 mapdata = (struct areltdata *) _bfd_read_ar_hdr (abfd); 813 807 if (mapdata == NULL) 814 return false;808 return FALSE; 815 809 parsed_size = mapdata->parsed_size; 816 810 bfd_release (abfd, (PTR) mapdata); /* Don't need it any more. */ 817 811 818 if (bfd_ read ((PTR) int_buf, 1,4, abfd) != 4)812 if (bfd_bread ((PTR) int_buf, (bfd_size_type) 4, abfd) != 4) 819 813 { 820 814 if (bfd_get_error () != bfd_error_system_call) 821 815 bfd_set_error (bfd_error_malformed_archive); 822 return false;816 return FALSE; 823 817 } 824 818 /* It seems that all numeric information in a coff archive is always … … 853 847 ardata->symdefs = (carsym *) bfd_zalloc (abfd, carsym_size + stringsize + 1); 854 848 if (ardata->symdefs == NULL) 855 return false;849 return FALSE; 856 850 carsyms = ardata->symdefs; 857 851 stringbase = ((char *) ardata->symdefs) + carsym_size; … … 861 855 if (raw_armap == NULL) 862 856 goto release_symdefs; 863 if (bfd_ read ((PTR) raw_armap, 1, ptrsize, abfd) != ptrsize864 || bfd_read ((PTR) stringbase, 1, stringsize, abfd) != stringsize)857 if (bfd_bread ((PTR) raw_armap, ptrsize, abfd) != ptrsize 858 || (bfd_bread ((PTR) stringbase, stringsize, abfd) != stringsize)) 865 859 { 866 860 if (bfd_get_error () != bfd_error_system_call) … … 885 879 ardata->first_file_filepos += (ardata->first_file_filepos) % 2; 886 880 887 bfd_has_map (abfd) = true;881 bfd_has_map (abfd) = TRUE; 888 882 bfd_release (abfd, (PTR) raw_armap); 889 883 … … 892 886 struct areltdata *tmp; 893 887 894 bfd_seek (abfd, 888 bfd_seek (abfd, ardata->first_file_filepos, SEEK_SET); 895 889 tmp = (struct areltdata *) _bfd_read_ar_hdr (abfd); 896 890 if (tmp != NULL) … … 900 894 { 901 895 ardata->first_file_filepos += 902 (tmp->parsed_size + sizeof (struct ar_hdr) + 1) & ~ 1;896 (tmp->parsed_size + sizeof (struct ar_hdr) + 1) & ~(unsigned) 1; 903 897 } 904 898 bfd_release (abfd, tmp); … … 906 900 } 907 901 908 return true;902 return TRUE; 909 903 910 904 release_raw_armap: … … 912 906 release_symdefs: 913 907 bfd_release (abfd, (PTR) (ardata)->symdefs); 914 return false;908 return FALSE; 915 909 } 916 910 917 911 /* This routine can handle either coff-style or bsd-style armaps. 918 Returns false on error, trueotherwise */919 920 b oolean912 Returns FALSE on error, TRUE otherwise */ 913 914 bfd_boolean 921 915 bfd_slurp_armap (abfd) 922 916 bfd *abfd; 923 917 { 924 918 char nextname[17]; 925 int i = bfd_ read ((PTR) nextname, 1,16, abfd);919 int i = bfd_bread ((PTR) nextname, (bfd_size_type) 16, abfd); 926 920 927 921 if (i == 0) 928 return true;922 return TRUE; 929 923 if (i != 16) 930 return false;931 932 if (bfd_seek (abfd, (file_ptr) - 933 return false;924 return FALSE; 925 926 if (bfd_seek (abfd, (file_ptr) -16, SEEK_CUR) != 0) 927 return FALSE; 934 928 935 929 if (!strncmp (nextname, "__.SYMDEF ", 16) … … 940 934 else if (!strncmp (nextname, "/SYM64/ ", 16)) 941 935 { 942 /* Irix 6 archive--must be recognized by code in elf64-mips.c. */ 936 /* 64bit ELF (Irix 6) archive. */ 937 #ifdef BFD64 938 return bfd_elf64_archive_slurp_armap (abfd); 939 #else 943 940 bfd_set_error (bfd_error_wrong_format); 944 return false; 945 } 946 947 bfd_has_map (abfd) = false; 948 return true; 949 } 950 951 952 /* Returns false on error, true otherwise */ 941 return FALSE; 942 #endif 943 } 944 945 bfd_has_map (abfd) = FALSE; 946 return TRUE; 947 } 948 949 950 /* Returns FALSE on error, TRUE otherwise */ 953 951 /* flavor 2 of a bsd armap, similar to bfd_slurp_bsd_armap except the 954 952 header is in a slightly different order and the map name is '/'. … … 957 955 #define HPUX_SYMDEF_COUNT_SIZE 2 958 956 959 b oolean957 bfd_boolean 960 958 bfd_slurp_bsd_armap_f2 (abfd) 961 959 bfd *abfd; … … 968 966 char *stringbase; 969 967 unsigned int stringsize; 968 bfd_size_type amt; 970 969 carsym *set; 971 int i = bfd_ read ((PTR) nextname, 1,16, abfd);970 int i = bfd_bread ((PTR) nextname, (bfd_size_type) 16, abfd); 972 971 973 972 if (i == 0) 974 return true;973 return TRUE; 975 974 if (i != 16) 976 return false;975 return FALSE; 977 976 978 977 /* The archive has at least 16 bytes in it. */ 979 if (bfd_seek (abfd, -16L, SEEK_CUR) != 0)980 return false;978 if (bfd_seek (abfd, (file_ptr) -16, SEEK_CUR) != 0) 979 return FALSE; 981 980 982 981 if (!strncmp (nextname, "__.SYMDEF ", 16) … … 986 985 if (strncmp (nextname, "/ ", 16)) 987 986 { 988 bfd_has_map (abfd) = false;989 return true;987 bfd_has_map (abfd) = FALSE; 988 return TRUE; 990 989 } 991 990 992 991 mapdata = (struct areltdata *) _bfd_read_ar_hdr (abfd); 993 992 if (mapdata == NULL) 994 return false; 995 996 raw_armap = (bfd_byte *) bfd_zalloc (abfd, mapdata->parsed_size); 993 return FALSE; 994 995 amt = mapdata->parsed_size; 996 raw_armap = (bfd_byte *) bfd_zalloc (abfd, amt); 997 997 if (raw_armap == NULL) 998 998 { 999 999 byebye: 1000 1000 bfd_release (abfd, (PTR) mapdata); 1001 return false; 1002 } 1003 1004 if (bfd_read ((PTR) raw_armap, 1, mapdata->parsed_size, abfd) != 1005 mapdata->parsed_size) 1001 return FALSE; 1002 } 1003 1004 if (bfd_bread ((PTR) raw_armap, amt, abfd) != amt) 1006 1005 { 1007 1006 if (bfd_get_error () != bfd_error_system_call) … … 1012 1011 } 1013 1012 1014 ardata->symdef_count = bfd_h_get_16 (abfd, (PTR) raw_armap);1013 ardata->symdef_count = H_GET_16 (abfd, (PTR) raw_armap); 1015 1014 1016 1015 if (ardata->symdef_count * BSD_SYMDEF_SIZE … … 1024 1023 ardata->cache = 0; 1025 1024 1026 stringsize = bfd_h_get_32 (abfd, raw_armap + HPUX_SYMDEF_COUNT_SIZE);1025 stringsize = H_GET_32 (abfd, raw_armap + HPUX_SYMDEF_COUNT_SIZE); 1027 1026 /* Skip sym count and string sz. */ 1028 1027 stringbase = ((char *) raw_armap … … 1030 1029 + BSD_STRING_COUNT_SIZE); 1031 1030 rbase = (bfd_byte *) stringbase + stringsize; 1032 ardata->symdefs = (carsym *) bfd_alloc (abfd, 1033 (ardata->symdef_count 1034 * BSD_SYMDEF_SIZE)); 1031 amt = (bfd_size_type) ardata->symdef_count * BSD_SYMDEF_SIZE; 1032 ardata->symdefs = (carsym *) bfd_alloc (abfd, amt); 1035 1033 if (!ardata->symdefs) 1036 return false;1034 return FALSE; 1037 1035 1038 1036 for (counter = 0, set = ardata->symdefs; … … 1040 1038 counter++, set++, rbase += BSD_SYMDEF_SIZE) 1041 1039 { 1042 set->name = bfd_h_get_32 (abfd, rbase) + stringbase;1043 set->file_offset = bfd_h_get_32 (abfd, rbase + BSD_SYMDEF_OFFSET_SIZE);1040 set->name = H_GET_32 (abfd, rbase) + stringbase; 1041 set->file_offset = H_GET_32 (abfd, rbase + BSD_SYMDEF_OFFSET_SIZE); 1044 1042 } 1045 1043 … … 1050 1048 we are done using the strings from it. For now, it seems 1051 1049 to be allocated on an objalloc anyway... */ 1052 bfd_has_map (abfd) = true;1053 return true;1050 bfd_has_map (abfd) = TRUE; 1051 return TRUE; 1054 1052 } 1055 1053 … … 1065 1063 extended the format by using the prefix // for the special element. */ 1066 1064 1067 /* Returns false on error, trueotherwise. */1068 1069 b oolean1065 /* Returns FALSE on error, TRUE otherwise. */ 1066 1067 bfd_boolean 1070 1068 _bfd_slurp_extended_name_table (abfd) 1071 1069 bfd *abfd; … … 1073 1071 char nextname[17]; 1074 1072 struct areltdata *namedata; 1073 bfd_size_type amt; 1075 1074 1076 1075 /* FIXME: Formatting sucks here, and in case of failure of BFD_READ, 1077 we probably don't want to return true. */1076 we probably don't want to return TRUE. */ 1078 1077 bfd_seek (abfd, bfd_ardata (abfd)->first_file_filepos, SEEK_SET); 1079 if (bfd_ read ((PTR) nextname, 1,16, abfd) == 16)1080 { 1081 if (bfd_seek (abfd, (file_ptr) - 1082 return false;1078 if (bfd_bread ((PTR) nextname, (bfd_size_type) 16, abfd) == 16) 1079 { 1080 if (bfd_seek (abfd, (file_ptr) -16, SEEK_CUR) != 0) 1081 return FALSE; 1083 1082 1084 1083 if (strncmp (nextname, "ARFILENAMES/ ", 16) != 0 && … … 1086 1085 { 1087 1086 bfd_ardata (abfd)->extended_names = NULL; 1088 return true;1087 return TRUE; 1089 1088 } 1090 1089 1091 1090 namedata = (struct areltdata *) _bfd_read_ar_hdr (abfd); 1092 1091 if (namedata == NULL) 1093 return false;1094 1095 bfd_ardata (abfd)->extended_names =1096 bfd_zalloc (abfd, namedata->parsed_size);1092 return FALSE; 1093 1094 amt = namedata->parsed_size; 1095 bfd_ardata (abfd)->extended_names = bfd_zalloc (abfd, amt); 1097 1096 if (bfd_ardata (abfd)->extended_names == NULL) 1098 1097 { 1099 1098 byebye: 1100 1099 bfd_release (abfd, (PTR) namedata); 1101 return false;1100 return FALSE; 1102 1101 } 1103 1102 1104 if (bfd_read ((PTR) bfd_ardata (abfd)->extended_names, 1, 1105 namedata->parsed_size, abfd) != namedata->parsed_size) 1103 if (bfd_bread ((PTR) bfd_ardata (abfd)->extended_names, amt, abfd) != amt) 1106 1104 { 1107 1105 if (bfd_get_error () != bfd_error_system_call) … … 1140 1138 #endif 1141 1139 } 1142 return true;1140 return TRUE; 1143 1141 } 1144 1142 … … 1153 1151 const char *file; 1154 1152 { 1155 CONSTchar *first;1156 CONSTchar *last;1153 const char *first; 1154 const char *last; 1157 1155 char *copy; 1158 1156 … … 1172 1170 } 1173 1171 1174 copy = (char *) bfd_alloc (abfd, last - first + 1);1172 copy = (char *) bfd_alloc (abfd, (bfd_size_type) (last - first + 1)); 1175 1173 if (copy == NULL) 1176 1174 return NULL; … … 1210 1208 /* Build a BFD style extended name table. */ 1211 1209 1212 b oolean1210 bfd_boolean 1213 1211 _bfd_archive_bsd_construct_extended_name_table (abfd, tabloc, tablen, name) 1214 1212 bfd *abfd; … … 1218 1216 { 1219 1217 *name = "ARFILENAMES/"; 1220 return _bfd_construct_extended_name_table (abfd, false, tabloc, tablen);1218 return _bfd_construct_extended_name_table (abfd, FALSE, tabloc, tablen); 1221 1219 } 1222 1220 1223 1221 /* Build an SVR4 style extended name table. */ 1224 1222 1225 b oolean1223 bfd_boolean 1226 1224 _bfd_archive_coff_construct_extended_name_table (abfd, tabloc, tablen, name) 1227 1225 bfd *abfd; … … 1231 1229 { 1232 1230 *name = "//"; 1233 return _bfd_construct_extended_name_table (abfd, true, tabloc, tablen);1231 return _bfd_construct_extended_name_table (abfd, TRUE, tabloc, tablen); 1234 1232 } 1235 1233 … … 1238 1236 table, and in tablen the length of the table. If it makes an entry 1239 1237 it clobbers the filename so that the element may be written without 1240 further massage. Returns true if it ran successfully, falseif1238 further massage. Returns TRUE if it ran successfully, FALSE if 1241 1239 something went wrong. A successful return may still involve a 1242 1240 zero-length tablen! */ 1243 1241 1244 b oolean1242 bfd_boolean 1245 1243 _bfd_construct_extended_name_table (abfd, trailing_slash, tabloc, tablen) 1246 1244 bfd *abfd; 1247 b oolean trailing_slash;1245 bfd_boolean trailing_slash; 1248 1246 char **tabloc; 1249 1247 bfd_size_type *tablen; 1250 1248 { 1251 1249 unsigned int maxname = abfd->xvec->ar_max_namelen; 1252 unsigned inttotal_namelen = 0;1250 bfd_size_type total_namelen = 0; 1253 1251 bfd *current; 1254 1252 char *strptr; … … 1264 1262 normal = normalize (current, current->filename); 1265 1263 if (normal == NULL) 1266 return false;1264 return FALSE; 1267 1265 1268 1266 thislen = strlen (normal); … … 1300 1298 1301 1299 if (total_namelen == 0) 1302 return true;1300 return TRUE; 1303 1301 1304 1302 *tabloc = bfd_zalloc (abfd, total_namelen); 1305 1303 if (*tabloc == NULL) 1306 return false;1304 return FALSE; 1307 1305 1308 1306 *tablen = total_namelen; … … 1317 1315 normal = normalize (current, current->filename); 1318 1316 if (normal == NULL) 1319 return false;1317 return FALSE; 1320 1318 1321 1319 thislen = strlen (normal); … … 1352 1350 } 1353 1351 1354 return true;1352 return TRUE; 1355 1353 } 1356 1354 … … 1399 1397 struct ar_hdr *hdr; 1400 1398 char *temp, *temp1; 1399 bfd_size_type amt; 1401 1400 1402 1401 if (member && (member->flags & BFD_IN_MEMORY) != 0) … … 1416 1415 } 1417 1416 1418 a red = (struct areltdata *) bfd_zalloc (abfd, sizeof (struct ar_hdr) +1419 sizeof (struct areltdata));1417 amt = sizeof (struct ar_hdr) + sizeof (struct areltdata); 1418 ared = (struct areltdata *) bfd_zalloc (abfd, amt); 1420 1419 if (ared == NULL) 1421 1420 return NULL; … … 1469 1468 stronger stomach to try to code around such a thing! */ 1470 1469 1471 struct ar_hdr *bfd_special_undocumented_glue PARAMS ((bfd *, const char *)); 1470 struct ar_hdr *bfd_special_undocumented_glue 1471 PARAMS ((bfd *, const char *)); 1472 1472 1473 1473 struct ar_hdr * … … 1544 1544 bfd_dont_truncate_arname (abfd, pathname, arhdr) 1545 1545 bfd *abfd; 1546 CONSTchar *pathname;1546 const char *pathname; 1547 1547 char *arhdr; 1548 1548 { … … 1584 1584 bfd_bsd_truncate_arname (abfd, pathname, arhdr) 1585 1585 bfd *abfd; 1586 CONSTchar *pathname;1586 const char *pathname; 1587 1587 char *arhdr; 1588 1588 { 1589 1589 struct ar_hdr *hdr = (struct ar_hdr *) arhdr; 1590 int length;1591 CONSTchar *filename = strrchr (pathname, '/');1592 int maxlen = ar_maxnamelen (abfd);1590 size_t length; 1591 const char *filename = strrchr (pathname, '/'); 1592 size_t maxlen = ar_maxnamelen (abfd); 1593 1593 1594 1594 #ifdef HAVE_DOS_BASED_FILE_SYSTEM … … 1635 1635 bfd_gnu_truncate_arname (abfd, pathname, arhdr) 1636 1636 bfd *abfd; 1637 CONSTchar *pathname;1637 const char *pathname; 1638 1638 char *arhdr; 1639 1639 { 1640 1640 struct ar_hdr *hdr = (struct ar_hdr *) arhdr; 1641 int length;1642 CONSTchar *filename = strrchr (pathname, '/');1643 int maxlen = ar_maxnamelen (abfd);1641 size_t length; 1642 const char *filename = strrchr (pathname, '/'); 1643 size_t maxlen = ar_maxnamelen (abfd); 1644 1644 1645 1645 #ifdef HAVE_DOS_BASED_FILE_SYSTEM … … 1681 1681 /* The BFD is open for write and has its format set to bfd_archive. */ 1682 1682 1683 b oolean1683 bfd_boolean 1684 1684 _bfd_write_archive_contents (arch) 1685 1685 bfd *arch; … … 1689 1689 bfd_size_type elength = 0; 1690 1690 const char *ename = NULL; 1691 boolean makemap = bfd_has_map (arch); 1692 boolean hasobjects = false; /* If no .o's, don't bother to make a map. */ 1691 bfd_boolean makemap = bfd_has_map (arch); 1692 /* If no .o's, don't bother to make a map. */ 1693 bfd_boolean hasobjects = FALSE; 1693 1694 bfd_size_type wrote; 1694 1695 unsigned int i; … … 1708 1709 { 1709 1710 bfd_set_error (bfd_error_invalid_operation); 1710 return false;1711 return FALSE; 1711 1712 } 1712 1713 if (!current->arelt_data) … … 1715 1716 (PTR) bfd_ar_hdr_from_filesystem (arch, current->filename, current); 1716 1717 if (!current->arelt_data) 1717 return false;1718 return FALSE; 1718 1719 1719 1720 /* Put in the file name. */ … … 1730 1731 #endif 1731 1732 ) 1732 hasobjects = true;1733 hasobjects = TRUE; 1733 1734 } 1734 1735 } … … 1736 1737 if (!BFD_SEND (arch, _bfd_construct_extended_name_table, 1737 1738 (arch, &etable, &elength, &ename))) 1738 return false;1739 return FALSE; 1739 1740 1740 1741 if (bfd_seek (arch, (file_ptr) 0, SEEK_SET) != 0) 1741 return false;1742 return FALSE; 1742 1743 #ifdef GNU960 1743 wrote = bfd_ write (BFD_GNU960_ARMAG (arch), 1,SARMAG, arch);1744 wrote = bfd_bwrite (BFD_GNU960_ARMAG (arch), (bfd_size_type) SARMAG, arch); 1744 1745 #else 1745 wrote = bfd_ write (ARMAG, 1,SARMAG, arch);1746 wrote = bfd_bwrite (ARMAG, (bfd_size_type) SARMAG, arch); 1746 1747 #endif 1747 1748 if (wrote != SARMAG) 1748 return false;1749 return FALSE; 1749 1750 1750 1751 if (makemap && hasobjects) 1751 1752 { 1752 if ( _bfd_compute_and_write_armap (arch, elength) != true)1753 return false;1753 if (! _bfd_compute_and_write_armap (arch, (unsigned int) elength)) 1754 return FALSE; 1754 1755 } 1755 1756 … … 1762 1763 /* Round size up to even number in archive header. */ 1763 1764 sprintf (&(hdr.ar_size[0]), "%-10d", 1764 (int) ((elength + 1) & ~ 1));1765 (int) ((elength + 1) & ~(bfd_size_type) 1)); 1765 1766 strncpy (hdr.ar_fmag, ARFMAG, 2); 1766 1767 for (i = 0; i < sizeof (struct ar_hdr); i++) 1767 1768 if (((char *) (&hdr))[i] == '\0') 1768 1769 (((char *) (&hdr))[i]) = ' '; 1769 if ((bfd_ write ((char *) &hdr, 1,sizeof (struct ar_hdr), arch)1770 if ((bfd_bwrite ((PTR) &hdr, (bfd_size_type) sizeof (struct ar_hdr), arch) 1770 1771 != sizeof (struct ar_hdr)) 1771 || bfd_ write (etable, 1, elength, arch) != elength)1772 return false;1772 || bfd_bwrite (etable, elength, arch) != elength) 1773 return FALSE; 1773 1774 if ((elength % 2) == 1) 1774 1775 { 1775 if (bfd_ write ("\012", 1,1, arch) != 1)1776 return false;1776 if (bfd_bwrite ("\012", (bfd_size_type) 1, arch) != 1) 1777 return FALSE; 1777 1778 } 1778 1779 } … … 1785 1786 1786 1787 /* Write ar header. */ 1787 if (bfd_write ((char *) hdr, 1, sizeof (*hdr), arch) != sizeof (*hdr)) 1788 return false; 1788 if (bfd_bwrite ((PTR) hdr, (bfd_size_type) sizeof (*hdr), arch) 1789 != sizeof (*hdr)) 1790 return FALSE; 1789 1791 if (bfd_seek (current, (file_ptr) 0, SEEK_SET) != 0) 1790 return false;1792 return FALSE; 1791 1793 while (remaining) 1792 1794 { … … 1795 1797 amt = remaining; 1796 1798 errno = 0; 1797 if (bfd_ read (buffer, amt, 1, current) != amt)1799 if (bfd_bread (buffer, (bfd_size_type) amt, current) != amt) 1798 1800 { 1799 1801 if (bfd_get_error () != bfd_error_system_call) 1800 1802 bfd_set_error (bfd_error_malformed_archive); 1801 return false;1803 return FALSE; 1802 1804 } 1803 if (bfd_ write (buffer, amt, 1, arch) != amt)1804 return false;1805 if (bfd_bwrite (buffer, (bfd_size_type) amt, arch) != amt) 1806 return FALSE; 1805 1807 remaining -= amt; 1806 1808 } 1807 1809 if ((arelt_size (current) % 2) == 1) 1808 1810 { 1809 if (bfd_ write ("\012", 1,1, arch) != 1)1810 return false;1811 if (bfd_bwrite ("\012", (bfd_size_type) 1, arch) != 1) 1812 return FALSE; 1811 1813 } 1812 1814 } … … 1831 1833 } 1832 1834 1833 return true;1835 return TRUE; 1834 1836 } 1835 1837 … … 1837 1839 /* Note that the namidx for the first symbol is 0. */ 1838 1840 1839 b oolean1841 bfd_boolean 1840 1842 _bfd_compute_and_write_armap (arch, elength) 1841 1843 bfd *arch; … … 1846 1848 file_ptr elt_no = 0; 1847 1849 struct orl *map = NULL; 1848 int orl_max = 1024; /* fine initial default */1849 int orl_count = 0;1850 unsigned int orl_max = 1024; /* fine initial default */ 1851 unsigned int orl_count = 0; 1850 1852 int stridx = 0; /* string index */ 1851 1853 asymbol **syms = NULL; 1852 1854 long syms_max = 0; 1853 boolean ret; 1855 bfd_boolean ret; 1856 bfd_size_type amt; 1854 1857 1855 1858 /* Dunno if this is the best place for this info... */ … … 1858 1861 elength += elength % 2; 1859 1862 1860 map = (struct orl *) bfd_malloc (orl_max * sizeof (struct orl)); 1863 amt = (bfd_size_type) orl_max * sizeof (struct orl); 1864 map = (struct orl *) bfd_malloc (amt); 1861 1865 if (map == NULL) 1862 1866 goto error_return; … … 1864 1868 /* We put the symbol names on the arch objalloc, and then discard 1865 1869 them when done. */ 1866 first_name = bfd_alloc (arch, 1);1870 first_name = bfd_alloc (arch, (bfd_size_type) 1); 1867 1871 if (first_name == NULL) 1868 1872 goto error_return; … … 1878 1882 current = current->next, elt_no++) 1879 1883 { 1880 if ( (bfd_check_format (current, bfd_object) == true)1881 && ( (bfd_get_file_flags (current) & HAS_SYMS)))1884 if (bfd_check_format (current, bfd_object) 1885 && (bfd_get_file_flags (current) & HAS_SYMS) != 0) 1882 1886 { 1883 1887 long storage; … … 1896 1900 free (syms); 1897 1901 syms_max = storage; 1898 syms = (asymbol **) bfd_malloc (( size_t) syms_max);1902 syms = (asymbol **) bfd_malloc ((bfd_size_type) syms_max); 1899 1903 if (syms == NULL) 1900 1904 goto error_return; … … 1920 1924 && ! bfd_is_und_section (sec)) 1921 1925 { 1922 size_tnamelen;1926 bfd_size_type namelen; 1923 1927 struct orl *new_map; 1924 1928 … … 1927 1931 { 1928 1932 orl_max *= 2; 1929 new_map = 1930 ((struct orl *) 1931 bfd_realloc (map, orl_max * sizeof (struct orl))); 1933 amt = (bfd_size_type) orl_max * sizeof (struct orl); 1934 new_map = (struct orl *) bfd_realloc (map, amt); 1932 1935 if (new_map == (struct orl *) NULL) 1933 1936 goto error_return; … … 1937 1940 1938 1941 namelen = strlen (syms[src_count]->name); 1939 map[orl_count].name = ((char **) 1940 bfd_alloc (arch, 1941 sizeof (char *))); 1942 amt = sizeof (char *); 1943 map[orl_count].name = (char **) bfd_alloc (arch, amt); 1942 1944 if (map[orl_count].name == NULL) 1943 1945 goto error_return; … … 1946 1948 goto error_return; 1947 1949 strcpy (*(map[orl_count].name), syms[src_count]->name); 1948 (map[orl_count]).pos = (file_ptr)current;1949 (map[orl_count]).namidx = stridx;1950 map[orl_count].u.abfd = current; 1951 map[orl_count].namidx = stridx; 1950 1952 1951 1953 stridx += namelen + 1; … … 1983 1985 bfd_release (arch, first_name); 1984 1986 1985 return false;1986 } 1987 1988 b oolean1987 return FALSE; 1988 } 1989 1990 bfd_boolean 1989 1991 bsd_write_armap (arch, elength, map, orl_count, stridx) 1990 1992 bfd *arch; … … 2025 2027 if (((char *) (&hdr))[i] == '\0') 2026 2028 (((char *) (&hdr))[i]) = ' '; 2027 if (bfd_ write ((char *) &hdr, 1,sizeof (struct ar_hdr), arch)2029 if (bfd_bwrite ((PTR) &hdr, (bfd_size_type) sizeof (struct ar_hdr), arch) 2028 2030 != sizeof (struct ar_hdr)) 2029 return false;2030 bfd_h_put_32 (arch, (bfd_vma)ranlibsize, temp);2031 if (bfd_ write (temp, 1,sizeof (temp), arch) != sizeof (temp))2032 return false;2031 return FALSE; 2032 H_PUT_32 (arch, ranlibsize, temp); 2033 if (bfd_bwrite (temp, (bfd_size_type) sizeof (temp), arch) != sizeof (temp)) 2034 return FALSE; 2033 2035 2034 2036 for (count = 0; count < orl_count; count++) … … 2036 2038 bfd_byte buf[BSD_SYMDEF_SIZE]; 2037 2039 2038 if ( ((bfd *) (map[count]).pos)!= last_elt)2040 if (map[count].u.abfd != last_elt) 2039 2041 { 2040 2042 do … … 2044 2046 current = current->next; 2045 2047 } 2046 while (current != (bfd *) (map[count]).pos);2048 while (current != map[count].u.abfd); 2047 2049 } /* if new archive element */ 2048 2050 2049 2051 last_elt = current; 2050 bfd_h_put_32 (arch, map[count].namidx, buf); 2051 bfd_h_put_32 (arch, firstreal, buf + BSD_SYMDEF_OFFSET_SIZE); 2052 if (bfd_write (buf, BSD_SYMDEF_SIZE, 1, arch) != BSD_SYMDEF_SIZE) 2053 return false; 2052 H_PUT_32 (arch, map[count].namidx, buf); 2053 H_PUT_32 (arch, firstreal, buf + BSD_SYMDEF_OFFSET_SIZE); 2054 if (bfd_bwrite (buf, (bfd_size_type) BSD_SYMDEF_SIZE, arch) 2055 != BSD_SYMDEF_SIZE) 2056 return FALSE; 2054 2057 } 2055 2058 2056 2059 /* Now write the strings themselves. */ 2057 bfd_h_put_32 (arch, stringsize, temp);2058 if (bfd_ write (temp, 1,sizeof (temp), arch) != sizeof (temp))2059 return false;2060 H_PUT_32 (arch, stringsize, temp); 2061 if (bfd_bwrite (temp, (bfd_size_type) sizeof (temp), arch) != sizeof (temp)) 2062 return FALSE; 2060 2063 for (count = 0; count < orl_count; count++) 2061 2064 { 2062 2065 size_t len = strlen (*map[count].name) + 1; 2063 2066 2064 if (bfd_ write (*map[count].name, 1,len, arch) != len)2065 return false;2067 if (bfd_bwrite (*map[count].name, (bfd_size_type) len, arch) != len) 2068 return FALSE; 2066 2069 } 2067 2070 … … 2070 2073 if (padit) 2071 2074 { 2072 if (bfd_ write ("", 1,1, arch) != 1)2073 return false;2074 } 2075 2076 return true;2075 if (bfd_bwrite ("", (bfd_size_type) 1, arch) != 1) 2076 return FALSE; 2077 } 2078 2079 return TRUE; 2077 2080 } 2078 2081 … … 2080 2083 file, so the linker will accept it. 2081 2084 2082 Return trueif the timestamp was OK, or an unusual problem happened.2083 Return falseif we updated the timestamp. */2084 2085 b oolean2085 Return TRUE if the timestamp was OK, or an unusual problem happened. 2086 Return FALSE if we updated the timestamp. */ 2087 2088 bfd_boolean 2086 2089 _bfd_archive_bsd_update_armap_timestamp (arch) 2087 2090 bfd *arch; … … 2096 2099 if (bfd_stat (arch, &archstat) == -1) 2097 2100 { 2098 perror (_("Reading archive file mod timestamp"));2101 bfd_perror (_("Reading archive file mod timestamp")); 2099 2102 2100 2103 /* Can't read mod time for some reason. */ 2101 return true;2104 return TRUE; 2102 2105 } 2103 2106 if (archstat.st_mtime <= bfd_ardata (arch)->armap_timestamp) 2104 2107 /* OK by the linker's rules. */ 2105 return true;2108 return TRUE; 2106 2109 2107 2110 /* Update the timestamp. */ … … 2119 2122 + offsetof (struct ar_hdr, ar_date[0])); 2120 2123 if (bfd_seek (arch, bfd_ardata (arch)->armap_datepos, SEEK_SET) != 0 2121 || (bfd_ write (hdr.ar_date, sizeof (hdr.ar_date), 1, arch)2124 || (bfd_bwrite (hdr.ar_date, (bfd_size_type) sizeof (hdr.ar_date), arch) 2122 2125 != sizeof (hdr.ar_date))) 2123 2126 { 2124 /* FIXME: bfd can't call perror. */ 2125 perror (_("Writing updated armap timestamp")); 2127 bfd_perror (_("Writing updated armap timestamp")); 2126 2128 2127 2129 /* Some error while writing. */ 2128 return true;2130 return TRUE; 2129 2131 } 2130 2132 2131 2133 /* We updated the timestamp successfully. */ 2132 return false;2134 return FALSE; 2133 2135 } 2134 2136 … … 2148 2150 */ 2149 2151 2150 b oolean2152 bfd_boolean 2151 2153 coff_write_armap (arch, elength, map, symbol_count, stridx) 2152 2154 bfd *arch; … … 2157 2159 { 2158 2160 /* The size of the ranlib is the number of exported symbols in the 2159 archive * the number of bytes in a int, + an int for the count. */2161 archive * the number of bytes in an int, + an int for the count. */ 2160 2162 unsigned int ranlibsize = (symbol_count * 4) + 4; 2161 2163 unsigned int stringsize = stridx; 2162 2164 unsigned int mapsize = stringsize + ranlibsize; 2163 file_ptrarchive_member_file_ptr;2165 unsigned int archive_member_file_ptr; 2164 2166 bfd *current = arch->archive_head; 2165 2167 unsigned int count; … … 2193 2195 /* Write the ar header for this item and the number of symbols. */ 2194 2196 2195 if (bfd_ write ((PTR) &hdr, 1,sizeof (struct ar_hdr), arch)2197 if (bfd_bwrite ((PTR) &hdr, (bfd_size_type) sizeof (struct ar_hdr), arch) 2196 2198 != sizeof (struct ar_hdr)) 2197 return false; 2198 2199 bfd_write_bigendian_4byte_int (arch, symbol_count); 2199 return FALSE; 2200 2201 if (!bfd_write_bigendian_4byte_int (arch, symbol_count)) 2202 return FALSE; 2200 2203 2201 2204 /* Two passes, first write the file offsets for each symbol - … … 2212 2215 out the object file's address in the archive. */ 2213 2216 2214 while (count < symbol_count && ((bfd *) (map[count]).pos)== current)2217 while (count < symbol_count && map[count].u.abfd == current) 2215 2218 { 2216 bfd_write_bigendian_4byte_int (arch, archive_member_file_ptr); 2219 if (!bfd_write_bigendian_4byte_int (arch, archive_member_file_ptr)) 2220 return FALSE; 2217 2221 count++; 2218 2222 } … … 2230 2234 size_t len = strlen (*map[count].name) + 1; 2231 2235 2232 if (bfd_ write (*map[count].name, 1,len, arch) != len)2233 return false;2236 if (bfd_bwrite (*map[count].name, (bfd_size_type) len, arch) != len) 2237 return FALSE; 2234 2238 } 2235 2239 … … 2238 2242 if (padit) 2239 2243 { 2240 if (bfd_ write ("", 1,1, arch) != 1)2241 return false;2242 } 2243 2244 return true;2245 } 2244 if (bfd_bwrite ("", (bfd_size_type) 1, arch) != 1) 2245 return FALSE; 2246 } 2247 2248 return TRUE; 2249 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/binutils/bfd/bfd-in2.h
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r617 r618 1 /* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically 2 generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", 3 "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", 4 "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", 5 "linker.c" and "simple.c". 6 Run "make headers" in your build bfd/ to regenerate. */ 7 1 8 /* Main header file for the bfd library -- portable access to object files. 2 Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 3 2000, 2001 4 Free Software Foundation, Inc. 9 10 Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 11 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. 12 5 13 Contributed by Cygnus Support. 6 14 7 ** NOTE: bfd.h and bfd-in2.h are GENERATED files. Don't change them; 8 ** instead, change bfd-in.h or the other BFD source files processed to 9 ** generate these files. 10 11 This file is part of BFD, the Binary File Descriptor library. 12 13 This program is free software; you can redistribute it and/or modify 14 it under the terms of the GNU General Public License as published by 15 the Free Software Foundation; either version 2 of the License, or 16 (at your option) any later version. 17 18 This program is distributed in the hope that it will be useful, 19 but WITHOUT ANY WARRANTY; without even the implied warranty of 20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 GNU General Public License for more details. 22 23 You should have received a copy of the GNU General Public License 24 along with this program; if not, write to the Free Software 25 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 26 27 /* bfd.h -- The only header file required by users of the bfd library 28 29 The bfd.h file is generated from bfd-in.h and various .c files; if you 30 change it, your changes will probably be lost. 31 32 All the prototypes and definitions following the comment "THE FOLLOWING 33 IS EXTRACTED FROM THE SOURCE" are extracted from the source files for 34 BFD. If you change it, someone oneday will extract it from the source 35 again, and your changes will be lost. To save yourself from this bind, 36 change the definitions in the source in the bfd directory. Type "make 37 docs" and then "make headers" in that directory, and magically this file 38 will change to reflect your changes. 39 40 If you don't have the tools to perform the extraction, then you are 41 safe from someone on your system trampling over your header files. 42 You should still maintain the equivalence between the source and this 43 file though; every change you make to the .c file should be reflected 44 here. */ 15 This file is part of BFD, the Binary File Descriptor library. 16 17 This program is free software; you can redistribute it and/or modify 18 it under the terms of the GNU General Public License as published by 19 the Free Software Foundation; either version 2 of the License, or 20 (at your option) any later version. 21 22 This program is distributed in the hope that it will be useful, 23 but WITHOUT ANY WARRANTY; without even the implied warranty of 24 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 25 GNU General Public License for more details. 26 27 You should have received a copy of the GNU General Public License 28 along with this program; if not, write to the Free Software 29 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 45 30 46 31 #ifndef __BFD_H_SEEN__ … … 52 37 53 38 #include "ansidecl.h" 54 55 /* These two lines get substitutions done by commands in Makefile.in. */ 56 #define BFD_VERSION "@VERSION@" 39 #include "symcat.h" 40 #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) 41 #ifndef SABER 42 /* This hack is to avoid a problem with some strict ANSI C preprocessors. 43 The problem is, "32_" is not a valid preprocessing token, and we don't 44 want extra underscores (e.g., "nlm_32_"). The XCONCAT2 macro will 45 cause the inner CONCAT2 macros to be evaluated first, producing 46 still-valid pp-tokens. Then the final concatenation can be done. */ 47 #undef CONCAT4 48 #define CONCAT4(a,b,c,d) XCONCAT2(CONCAT2(a,b),CONCAT2(c,d)) 49 #endif 50 #endif 51 52 /* The word size used by BFD on the host. This may be 64 with a 32 53 bit target if the host is 64 bit, or if other 64 bit targets have 54 been selected with --enable-targets, or if --enable-64-bit-bfd. */ 57 55 #define BFD_ARCH_SIZE @wordsize@ 56 57 /* The word size of the default bfd target. */ 58 #define BFD_DEFAULT_TARGET_SIZE @bfd_default_target_size@ 59 58 60 #define BFD_HOST_64BIT_LONG @BFD_HOST_64BIT_LONG@ 59 61 #if @BFD_HOST_64_BIT_DEFINED@ … … 74 76 #endif 75 77 76 /* forward declaration */ 77 typedef struct _bfd bfd; 78 79 /* To squelch erroneous compiler warnings ("illegal pointer 80 combination") from the SVR3 compiler, we would like to typedef 81 boolean to int (it doesn't like functions which return boolean. 82 Making sure they are never implicitly declared to return int 83 doesn't seem to help). But this file is not configured based on 84 the host. */ 85 /* General rules: functions which are boolean return true on success 86 and false on failure (unless they're a predicate). -- bfd.doc */ 87 /* I'm sure this is going to break something and someone is going to 88 force me to change it. */ 89 /* typedef enum boolean {false, true} boolean; */ 90 /* Yup, SVR4 has a "typedef enum boolean" in <sys/types.h> -fnf */ 91 /* It gets worse if the host also defines a true/false enum... -sts */ 92 /* And even worse if your compiler has built-in boolean types... -law */ 93 #if defined (__GNUG__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 6)) 94 #define TRUE_FALSE_ALREADY_DEFINED 78 /* Forward declaration. */ 79 typedef struct bfd bfd; 80 81 /* Boolean type used in bfd. Too many systems define their own 82 versions of "boolean" for us to safely typedef a "boolean" of 83 our own. Using an enum for "bfd_boolean" has its own set of 84 problems, with strange looking casts required to avoid warnings 85 on some older compilers. Thus we just use an int. 86 87 General rule: Functions which are bfd_boolean return TRUE on 88 success and FALSE on failure (unless they're a predicate). */ 89 90 typedef int bfd_boolean; 91 #undef FALSE 92 #undef TRUE 93 #define FALSE 0 94 #define TRUE 1 95 96 #if 0 97 /* Poison. */ 98 #undef false 99 #undef true 100 #define false dont_use_false_in_bfd 101 #define true dont_use_true_in_bfd 95 102 #endif 96 #ifdef MPW97 /* Pre-emptive strike - get the file with the enum. */98 #include <Types.h>99 #define TRUE_FALSE_ALREADY_DEFINED100 #endif /* MPW */101 #ifndef TRUE_FALSE_ALREADY_DEFINED102 typedef enum bfd_boolean {false, true} boolean;103 #define BFD_TRUE_FALSE104 #else105 /* Use enum names that will appear nowhere else. */106 typedef enum bfd_boolean {bfd_fffalse, bfd_tttrue} boolean;107 #endif108 109 /* A pointer to a position in a file. */110 /* FIXME: This should be using off_t from <sys/types.h>.111 For now, try to avoid breaking stuff by not including <sys/types.h> here.112 This will break on systems with 64-bit file offsets (e.g. 4.4BSD).113 Probably the best long-term answer is to avoid using file_ptr AND off_t114 in this header file, and to handle this in the BFD implementation115 rather than in its interface. */116 /* typedef off_t file_ptr; */117 typedef long int file_ptr;118 103 119 104 /* Support for different sizes of target format ints and addresses. … … 184 169 #endif /* not BFD64 */ 185 170 171 /* A pointer to a position in a file. */ 172 /* FIXME: This should be using off_t from <sys/types.h>. 173 For now, try to avoid breaking stuff by not including <sys/types.h> here. 174 This will break on systems with 64-bit file offsets (e.g. 4.4BSD). 175 Probably the best long-term answer is to avoid using file_ptr AND off_t 176 in this header file, and to handle this in the BFD implementation 177 rather than in its interface. */ 178 /* typedef off_t file_ptr; */ 179 typedef bfd_signed_vma file_ptr; 180 typedef bfd_vma ufile_ptr; 181 182 extern void bfd_sprintf_vma 183 PARAMS ((bfd *, char *, bfd_vma)); 184 extern void bfd_fprintf_vma 185 PARAMS ((bfd *, PTR, bfd_vma)); 186 186 187 #define printf_vma(x) fprintf_vma(stdout,x) 188 #define bfd_printf_vma(abfd,x) bfd_fprintf_vma (abfd,stdout,x) 187 189 188 190 typedef unsigned int flagword; /* 32 bits of flags */ … … 190 192 191 193 192 /** File formats */ 193 194 typedef enum bfd_format { 195 bfd_unknown = 0, /* file format is unknown */ 196 bfd_object, /* linker/assember/compiler output */ 197 bfd_archive, /* object archive file */ 198 bfd_core, /* core dump */ 199 bfd_type_end} /* marks the end; don't use it! */ 200 bfd_format; 194 /* File formats. */ 195 196 typedef enum bfd_format 197 { 198 bfd_unknown = 0, /* File format is unknown. */ 199 bfd_object, /* Linker/assember/compiler output. */ 200 bfd_archive, /* Object archive file. */ 201 bfd_core, /* Core dump. */ 202 bfd_type_end /* Marks the end; don't use it! */ 203 } 204 bfd_format; 201 205 202 206 /* Values that may appear in the flags field of a BFD. These also … … 257 261 #define BFD_IN_MEMORY 0x800 258 262 259 260 /* symbols and relocation */ 263 /* The sections in this BFD specify a memory page. */ 264 #define HAS_LOAD_PAGE 0x1000 265 266 267 /* Symbols and relocation. */ 261 268 262 269 /* A count of carsyms (canonical archive symbols). */ … … 282 289 283 290 /* A canonical archive symbol. */ 284 /* This is a type pun with struct ranlib on purpose! */ 285 typedef struct carsym { 291 /* This is a type pun with struct ranlib on purpose! */ 292 typedef struct carsym 293 { 286 294 char *name; 287 file_ptr file_offset; /* look here to find the file */ 288 } carsym; /* to make these you call a carsymogen */ 295 file_ptr file_offset; /* Look here to find the file. */ 296 } 297 carsym; /* To make these you call a carsymogen. */ 289 298 290 299 /* Used in generating armaps (archive tables of contents). 291 Perhaps just a forward definition would do? */ 292 struct orl { /* output ranlib */ 293 char **name; /* symbol name */ 294 file_ptr pos; /* bfd* or file position */ 295 int namidx; /* index into string table */ 300 Perhaps just a forward definition would do? */ 301 struct orl /* Output ranlib. */ 302 { 303 char **name; /* Symbol name. */ 304 union 305 { 306 file_ptr pos; 307 bfd *abfd; 308 } u; /* bfd* or file position. */ 309 int namidx; /* Index into string table. */ 296 310 }; 297 311 298 312 299 /* Linenumber stuff */ 300 typedef struct lineno_cache_entry { 301 unsigned int line_number; /* Linenumber from start of function*/ 302 union { 303 struct symbol_cache_entry *sym; /* Function name */ 304 unsigned long offset; /* Offset into section */ 313 /* Linenumber stuff. */ 314 typedef struct lineno_cache_entry 315 { 316 unsigned int line_number; /* Linenumber from start of function. */ 317 union 318 { 319 struct symbol_cache_entry *sym; /* Function name. */ 320 bfd_vma offset; /* Offset into section. */ 305 321 } u; 306 } alent; 307 308 309 /* object and core file sections */ 322 } 323 alent; 324 325 326 /* Object and core file sections. */ 310 327 311 328 #define align_power(addr, align) \ 312 ( ((addr) + ((1<<(align))-1)) & (-1 << (align)))329 (((addr) + ((bfd_vma) 1 << (align)) - 1) & ((bfd_vma) -1 << (align))) 313 330 314 331 typedef struct sec *sec_ptr; … … 316 333 #define bfd_get_section_name(bfd, ptr) ((ptr)->name + 0) 317 334 #define bfd_get_section_vma(bfd, ptr) ((ptr)->vma + 0) 335 #define bfd_get_section_lma(bfd, ptr) ((ptr)->lma + 0) 318 336 #define bfd_get_section_alignment(bfd, ptr) ((ptr)->alignment_power + 0) 319 337 #define bfd_section_name(bfd, ptr) ((ptr)->name) … … 327 345 #define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0) 328 346 329 #define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = (boolean)true), true)330 #define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)), true)331 #define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)), true)347 #define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE) 348 #define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE) 349 #define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE) 332 350 333 351 typedef struct stat stat_type; … … 347 365 symvalue value; 348 366 char type; 349 CONSTchar *name; /* Symbol name. */367 const char *name; /* Symbol name. */ 350 368 unsigned char stab_type; /* Stab type. */ 351 369 char stab_other; /* Stab other. */ 352 370 short stab_desc; /* Stab desc. */ 353 CONSTchar *stab_name; /* String for stab type. */371 const char *stab_name; /* String for stab type. */ 354 372 } symbol_info; 355 373 356 374 /* Get the name of a stabs type code. */ 357 375 358 extern const char *bfd_get_stab_name PARAMS ((int)); 376 extern const char *bfd_get_stab_name 377 PARAMS ((int)); 359 378 360 379 … … 390 409 each function should be written to allocate a new block of memory 391 410 only if the argument is NULL. */ 392 struct bfd_hash_entry *(*newfunc) PARAMS ((struct bfd_hash_entry *, 393 struct bfd_hash_table *, 394 const char *)); 411 struct bfd_hash_entry *(*newfunc) 412 PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); 395 413 /* An objalloc for this hash table. This is a struct objalloc *, 396 414 but we use PTR to avoid requiring the inclusion of objalloc.h. */ … … 399 417 400 418 /* Initialize a hash table. */ 401 extern b oolean bfd_hash_table_init419 extern bfd_boolean bfd_hash_table_init 402 420 PARAMS ((struct bfd_hash_table *, 403 421 struct bfd_hash_entry *(*) (struct bfd_hash_entry *, … … 406 424 407 425 /* Initialize a hash table specifying a size. */ 408 extern b oolean bfd_hash_table_init_n426 extern bfd_boolean bfd_hash_table_init_n 409 427 PARAMS ((struct bfd_hash_table *, 410 428 struct bfd_hash_entry *(*) (struct bfd_hash_entry *, … … 414 432 415 433 /* Free up a hash table. */ 416 extern void bfd_hash_table_free PARAMS ((struct bfd_hash_table *)); 417 418 /* Look up a string in a hash table. If CREATE is true, a new entry 434 extern void bfd_hash_table_free 435 PARAMS ((struct bfd_hash_table *)); 436 437 /* Look up a string in a hash table. If CREATE is TRUE, a new entry 419 438 will be created for this string if one does not already exist. The 420 COPY argument must be trueif this routine should copy the string439 COPY argument must be TRUE if this routine should copy the string 421 440 into newly allocated memory when adding an entry. */ 422 441 extern struct bfd_hash_entry *bfd_hash_lookup 423 PARAMS ((struct bfd_hash_table *, const char *, b oolean create,424 b oolean copy));442 PARAMS ((struct bfd_hash_table *, const char *, bfd_boolean create, 443 bfd_boolean copy)); 425 444 426 445 /* Replace an entry in a hash table. */ … … 435 454 436 455 /* Grab some space for a hash table entry. */ 437 extern PTR bfd_hash_allocate PARAMS ((struct bfd_hash_table *,438 456 extern PTR bfd_hash_allocate 457 PARAMS ((struct bfd_hash_table *, unsigned int)); 439 458 440 459 /* Traverse a hash table in a random order, calling a function on each 441 element. If the function returns false, the traversal stops. The460 element. If the function returns FALSE, the traversal stops. The 442 461 INFO argument is passed to the function. */ 443 extern void bfd_hash_traverse PARAMS ((struct bfd_hash_table *, 444 boolean (*) (struct bfd_hash_entry *, 445 PTR), 446 PTR info)); 447 448 449 /* Semi-portable string concatenation in cpp. 450 The CAT4 hack is to avoid a problem with some strict ANSI C preprocessors. 451 The problem is, "32_" is not a valid preprocessing token, and we don't 452 want extra underscores (e.g., "nlm_32_"). The XCAT2 macro will cause the 453 inner CAT macros to be evaluated first, producing still-valid pp-tokens. 454 Then the final concatenation can be done. (Sigh.) */ 455 #ifndef CAT 456 #ifdef SABER 457 #define CAT(a,b) a##b 458 #define CAT3(a,b,c) a##b##c 459 #define CAT4(a,b,c,d) a##b##c##d 460 #else 461 #if defined(__STDC__) || defined(ALMOST_STDC) 462 #define CAT(a,b) a##b 463 #define CAT3(a,b,c) a##b##c 464 #define XCAT2(a,b) CAT(a,b) 465 #define CAT4(a,b,c,d) XCAT2(CAT(a,b),CAT(c,d)) 466 #else 467 #define CAT(a,b) a/**/b 468 #define CAT3(a,b,c) a/**/b/**/c 469 #define CAT4(a,b,c,d) a/**/b/**/c/**/d 470 #endif 471 #endif 472 #endif 462 extern void bfd_hash_traverse 463 PARAMS ((struct bfd_hash_table *, 464 bfd_boolean (*) (struct bfd_hash_entry *, PTR), 465 PTR info)); 473 466 474 467 #define COFF_SWAP_TABLE (PTR) &bfd_coff_std_swap_table 475 468 476 477 /* User program access to BFD facilities */ 469 /* User program access to BFD facilities. */ 478 470 479 471 /* Direct I/O routines, for programs which know more about the object 480 472 file than BFD does. Use higher level routines if possible. */ 481 473 482 extern bfd_size_type bfd_read 483 PARAMS ((PTR, bfd_size_type size, bfd_size_type nitems, bfd *abfd)); 484 extern bfd_size_type bfd_write 485 PARAMS ((const PTR, bfd_size_type size, bfd_size_type nitems, bfd *abfd)); 486 extern int bfd_seek PARAMS ((bfd *abfd, file_ptr fp, int direction)); 487 extern long bfd_tell PARAMS ((bfd *abfd)); 488 extern int bfd_flush PARAMS ((bfd *abfd)); 489 extern int bfd_stat PARAMS ((bfd *abfd, struct stat *)); 474 extern bfd_size_type bfd_bread 475 PARAMS ((PTR, bfd_size_type, bfd *)); 476 extern bfd_size_type bfd_bwrite 477 PARAMS ((const PTR, bfd_size_type, bfd *)); 478 extern int bfd_seek 479 PARAMS ((bfd *, file_ptr, int)); 480 extern ufile_ptr bfd_tell 481 PARAMS ((bfd *)); 482 extern int bfd_flush 483 PARAMS ((bfd *)); 484 extern int bfd_stat 485 PARAMS ((bfd *, struct stat *)); 486 487 /* Deprecated old routines. */ 488 #if __GNUC__ 489 #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ 490 (warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ 491 bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) 492 #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ 493 (warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ 494 bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) 495 #else 496 #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ 497 (warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ 498 bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) 499 #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ 500 (warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ 501 bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) 502 #endif 503 extern void warn_deprecated 504 PARAMS ((const char *, const char *, int, const char *)); 490 505 491 506 /* Cast from const char * to char * so that caller can assign to … … 519 534 #define bfd_count_sections(abfd) ((abfd)->section_count) 520 535 536 #define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount) 537 521 538 #define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char) 522 539 523 #define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = (boolean) (bool)), true) 524 525 extern boolean bfd_record_phdr 526 PARAMS ((bfd *, unsigned long, boolean, flagword, boolean, bfd_vma, 527 boolean, boolean, unsigned int, struct sec **)); 540 #define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE) 541 542 extern bfd_boolean bfd_cache_close 543 PARAMS ((bfd *abfd)); 544 /* NB: This declaration should match the autogenerated one in libbfd.h. */ 545 546 extern bfd_boolean bfd_record_phdr 547 PARAMS ((bfd *, unsigned long, bfd_boolean, flagword, bfd_boolean, bfd_vma, 548 bfd_boolean, bfd_boolean, unsigned int, struct sec **)); 528 549 529 550 /* Byte swapping routines. */ 530 551 531 bfd_vma bfd_getb64 PARAMS ((const unsigned char *)); 532 bfd_vma bfd_getl64 PARAMS ((const unsigned char *)); 533 bfd_signed_vma bfd_getb_signed_64 PARAMS ((const unsigned char *)); 534 bfd_signed_vma bfd_getl_signed_64 PARAMS ((const unsigned char *)); 535 bfd_vma bfd_getb32 PARAMS ((const unsigned char *)); 536 bfd_vma bfd_getl32 PARAMS ((const unsigned char *)); 537 bfd_signed_vma bfd_getb_signed_32 PARAMS ((const unsigned char *)); 538 bfd_signed_vma bfd_getl_signed_32 PARAMS ((const unsigned char *)); 539 bfd_vma bfd_getb16 PARAMS ((const unsigned char *)); 540 bfd_vma bfd_getl16 PARAMS ((const unsigned char *)); 541 bfd_signed_vma bfd_getb_signed_16 PARAMS ((const unsigned char *)); 542 bfd_signed_vma bfd_getl_signed_16 PARAMS ((const unsigned char *)); 543 void bfd_putb64 PARAMS ((bfd_vma, unsigned char *)); 544 void bfd_putl64 PARAMS ((bfd_vma, unsigned char *)); 545 void bfd_putb32 PARAMS ((bfd_vma, unsigned char *)); 546 void bfd_putl32 PARAMS ((bfd_vma, unsigned char *)); 547 void bfd_putb16 PARAMS ((bfd_vma, unsigned char *)); 548 void bfd_putl16 PARAMS ((bfd_vma, unsigned char *)); 552 bfd_vma bfd_getb64 553 PARAMS ((const unsigned char *)); 554 bfd_vma bfd_getl64 555 PARAMS ((const unsigned char *)); 556 bfd_signed_vma bfd_getb_signed_64 557 PARAMS ((const unsigned char *)); 558 bfd_signed_vma bfd_getl_signed_64 559 PARAMS ((const unsigned char *)); 560 bfd_vma bfd_getb32 561 PARAMS ((const unsigned char *)); 562 bfd_vma bfd_getl32 563 PARAMS ((const unsigned char *)); 564 bfd_signed_vma bfd_getb_signed_32 565 PARAMS ((const unsigned char *)); 566 bfd_signed_vma bfd_getl_signed_32 567 PARAMS ((const unsigned char *)); 568 bfd_vma bfd_getb16 569 PARAMS ((const unsigned char *)); 570 bfd_vma bfd_getl16 571 PARAMS ((const unsigned char *)); 572 bfd_signed_vma bfd_getb_signed_16 573 PARAMS ((const unsigned char *)); 574 bfd_signed_vma bfd_getl_signed_16 575 PARAMS ((const unsigned char *)); 576 void bfd_putb64 577 PARAMS ((bfd_vma, unsigned char *)); 578 void bfd_putl64 579 PARAMS ((bfd_vma, unsigned char *)); 580 void bfd_putb32 581 PARAMS ((bfd_vma, unsigned char *)); 582 void bfd_putl32 583 PARAMS ((bfd_vma, unsigned char *)); 584 void bfd_putb16 585 PARAMS ((bfd_vma, unsigned char *)); 586 void bfd_putl16 587 PARAMS ((bfd_vma, unsigned char *)); 549 588 550 589 /* Byte swapping routines which take size and endiannes as arguments. */ 551 590 552 bfd_vma bfd_get_bits PARAMS ((bfd_byte *, int, boolean)); 553 void bfd_put_bits PARAMS ((bfd_vma, bfd_byte *, int, boolean)); 591 bfd_vma bfd_get_bits 592 PARAMS ((bfd_byte *, int, bfd_boolean)); 593 void bfd_put_bits 594 PARAMS ((bfd_vma, bfd_byte *, int, bfd_boolean)); 554 595 555 596 … … 565 606 struct bfd_elf_version_tree; 566 607 #endif 567 extern bfd_vma bfd_ecoff_get_gp_value PARAMS ((bfd * abfd)); 568 extern boolean bfd_ecoff_set_gp_value PARAMS ((bfd *abfd, bfd_vma gp_value)); 569 extern boolean bfd_ecoff_set_regmasks 608 extern bfd_vma bfd_ecoff_get_gp_value 609 PARAMS ((bfd * abfd)); 610 extern bfd_boolean bfd_ecoff_set_gp_value 611 PARAMS ((bfd *abfd, bfd_vma gp_value)); 612 extern bfd_boolean bfd_ecoff_set_regmasks 570 613 PARAMS ((bfd *abfd, unsigned long gprmask, unsigned long fprmask, 571 614 unsigned long *cprmask)); … … 578 621 const struct ecoff_debug_swap *output_swap, 579 622 struct bfd_link_info *)); 580 extern b oolean bfd_ecoff_debug_accumulate623 extern bfd_boolean bfd_ecoff_debug_accumulate 581 624 PARAMS ((PTR handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, 582 625 const struct ecoff_debug_swap *output_swap, … … 584 627 const struct ecoff_debug_swap *input_swap, 585 628 struct bfd_link_info *)); 586 extern b oolean bfd_ecoff_debug_accumulate_other629 extern bfd_boolean bfd_ecoff_debug_accumulate_other 587 630 PARAMS ((PTR handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, 588 631 const struct ecoff_debug_swap *output_swap, bfd *input_bfd, 589 632 struct bfd_link_info *)); 590 extern b oolean bfd_ecoff_debug_externals633 extern bfd_boolean bfd_ecoff_debug_externals 591 634 PARAMS ((bfd *abfd, struct ecoff_debug_info *debug, 592 635 const struct ecoff_debug_swap *swap, 593 b oolean relocateable,594 b oolean (*get_extr) (struct symbol_cache_entry *,595 struct ecoff_extr *),636 bfd_boolean relocateable, 637 bfd_boolean (*get_extr) (struct symbol_cache_entry *, 638 struct ecoff_extr *), 596 639 void (*set_index) (struct symbol_cache_entry *, 597 640 bfd_size_type))); 598 extern b oolean bfd_ecoff_debug_one_external641 extern bfd_boolean bfd_ecoff_debug_one_external 599 642 PARAMS ((bfd *abfd, struct ecoff_debug_info *debug, 600 643 const struct ecoff_debug_swap *swap, … … 603 646 PARAMS ((bfd *abfd, struct ecoff_debug_info *debug, 604 647 const struct ecoff_debug_swap *swap)); 605 extern b oolean bfd_ecoff_write_debug648 extern bfd_boolean bfd_ecoff_write_debug 606 649 PARAMS ((bfd *abfd, struct ecoff_debug_info *debug, 607 650 const struct ecoff_debug_swap *swap, file_ptr where)); 608 extern b oolean bfd_ecoff_write_accumulated_debug651 extern bfd_boolean bfd_ecoff_write_accumulated_debug 609 652 PARAMS ((PTR handle, bfd *abfd, struct ecoff_debug_info *debug, 610 653 const struct ecoff_debug_swap *swap, 611 654 struct bfd_link_info *info, file_ptr where)); 612 extern b oolean bfd_mips_ecoff_create_embedded_relocs655 extern bfd_boolean bfd_mips_ecoff_create_embedded_relocs 613 656 PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *, 614 657 char **)); … … 623 666 }; 624 667 625 extern b oolean bfd_elf32_record_link_assignment626 PARAMS ((bfd *, struct bfd_link_info *, const char *, b oolean));627 extern b oolean bfd_elf64_record_link_assignment628 PARAMS ((bfd *, struct bfd_link_info *, const char *, b oolean));668 extern bfd_boolean bfd_elf32_record_link_assignment 669 PARAMS ((bfd *, struct bfd_link_info *, const char *, bfd_boolean)); 670 extern bfd_boolean bfd_elf64_record_link_assignment 671 PARAMS ((bfd *, struct bfd_link_info *, const char *, bfd_boolean)); 629 672 extern struct bfd_link_needed_list *bfd_elf_get_needed_list 630 673 PARAMS ((bfd *, struct bfd_link_info *)); 631 extern b oolean bfd_elf_get_bfd_needed_list674 extern bfd_boolean bfd_elf_get_bfd_needed_list 632 675 PARAMS ((bfd *, struct bfd_link_needed_list **)); 633 extern b oolean bfd_elf32_size_dynamic_sections634 PARAMS ((bfd *, const char *, const char *, boolean,const char *,676 extern bfd_boolean bfd_elf32_size_dynamic_sections 677 PARAMS ((bfd *, const char *, const char *, const char *, 635 678 const char * const *, struct bfd_link_info *, struct sec **, 636 679 struct bfd_elf_version_tree *)); 637 extern b oolean bfd_elf64_size_dynamic_sections638 PARAMS ((bfd *, const char *, const char *, boolean,const char *,680 extern bfd_boolean bfd_elf64_size_dynamic_sections 681 PARAMS ((bfd *, const char *, const char *, const char *, 639 682 const char * const *, struct bfd_link_info *, struct sec **, 640 683 struct bfd_elf_version_tree *)); 641 extern void bfd_elf_set_dt_needed_name PARAMS ((bfd *, const char *)); 642 extern void bfd_elf_set_dt_needed_soname PARAMS ((bfd *, const char *)); 643 extern const char *bfd_elf_get_dt_soname PARAMS ((bfd *)); 684 extern void bfd_elf_set_dt_needed_name 685 PARAMS ((bfd *, const char *)); 686 extern void bfd_elf_set_dt_needed_soname 687 PARAMS ((bfd *, const char *)); 688 extern const char *bfd_elf_get_dt_soname 689 PARAMS ((bfd *)); 644 690 extern struct bfd_link_needed_list *bfd_elf_get_runpath_list 691 PARAMS ((bfd *, struct bfd_link_info *)); 692 extern bfd_boolean bfd_elf32_discard_info 693 PARAMS ((bfd *, struct bfd_link_info *)); 694 extern bfd_boolean bfd_elf64_discard_info 645 695 PARAMS ((bfd *, struct bfd_link_info *)); 646 696 … … 648 698 copy of ABFD's program header table entries. Return -1 if an error 649 699 occurs; bfd_get_error will return an appropriate code. */ 650 extern long bfd_get_elf_phdr_upper_bound PARAMS ((bfd *abfd)); 700 extern long bfd_get_elf_phdr_upper_bound 701 PARAMS ((bfd *abfd)); 651 702 652 703 /* Copy ABFD's program header table entries to *PHDRS. The entries … … 657 708 Return the number of program header table entries read, or -1 if an 658 709 error occurs; bfd_get_error will return an appropriate code. */ 659 extern int bfd_get_elf_phdrs PARAMS ((bfd *abfd, void *phdrs)); 710 extern int bfd_get_elf_phdrs 711 PARAMS ((bfd *abfd, void *phdrs)); 660 712 661 713 /* Return the arch_size field of an elf bfd, or -1 if not elf. */ 662 extern int bfd_get_arch_size PARAMS ((bfd *)); 663 664 /* Return true if address "naturally" sign extends, or -1 if not elf. */ 665 extern int bfd_get_sign_extend_vma PARAMS ((bfd *)); 666 667 extern boolean bfd_m68k_elf32_create_embedded_relocs 714 extern int bfd_get_arch_size 715 PARAMS ((bfd *)); 716 717 /* Return TRUE if address "naturally" sign extends, or -1 if not elf. */ 718 extern int bfd_get_sign_extend_vma 719 PARAMS ((bfd *)); 720 721 extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs 668 722 PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *, 669 723 char **)); 724 extern bfd_boolean bfd_mips_elf32_create_embedded_relocs 725 PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *, 726 char **)); 670 727 671 728 /* SunOS shared library support routines for the linker. */ … … 673 730 extern struct bfd_link_needed_list *bfd_sunos_get_needed_list 674 731 PARAMS ((bfd *, struct bfd_link_info *)); 675 extern b oolean bfd_sunos_record_link_assignment732 extern bfd_boolean bfd_sunos_record_link_assignment 676 733 PARAMS ((bfd *, struct bfd_link_info *, const char *)); 677 extern b oolean bfd_sunos_size_dynamic_sections734 extern bfd_boolean bfd_sunos_size_dynamic_sections 678 735 PARAMS ((bfd *, struct bfd_link_info *, struct sec **, struct sec **, 679 736 struct sec **)); … … 681 738 /* Linux shared library support routines for the linker. */ 682 739 683 extern b oolean bfd_i386linux_size_dynamic_sections740 extern bfd_boolean bfd_i386linux_size_dynamic_sections 684 741 PARAMS ((bfd *, struct bfd_link_info *)); 685 extern b oolean bfd_m68klinux_size_dynamic_sections742 extern bfd_boolean bfd_m68klinux_size_dynamic_sections 686 743 PARAMS ((bfd *, struct bfd_link_info *)); 687 extern b oolean bfd_sparclinux_size_dynamic_sections744 extern bfd_boolean bfd_sparclinux_size_dynamic_sections 688 745 PARAMS ((bfd *, struct bfd_link_info *)); 689 746 … … 693 750 typedef struct _bfd_window_internal bfd_window_internal; 694 751 695 typedef struct _bfd_window { 752 typedef struct _bfd_window 753 { 696 754 /* What the user asked for. */ 697 755 PTR data; … … 704 762 application wants two writable copies! */ 705 763 struct _bfd_window_internal *i; 706 } bfd_window; 707 708 extern void bfd_init_window PARAMS ((bfd_window *)); 709 extern void bfd_free_window PARAMS ((bfd_window *)); 710 extern boolean bfd_get_file_window 711 PARAMS ((bfd *, file_ptr, bfd_size_type, bfd_window *, boolean)); 764 } 765 bfd_window; 766 767 extern void bfd_init_window 768 PARAMS ((bfd_window *)); 769 extern void bfd_free_window 770 PARAMS ((bfd_window *)); 771 extern bfd_boolean bfd_get_file_window 772 PARAMS ((bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean)); 712 773 713 774 /* XCOFF support routines for the linker. */ 714 775 715 extern b oolean bfd_xcoff_link_record_set776 extern bfd_boolean bfd_xcoff_link_record_set 716 777 PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, 717 778 bfd_size_type)); 718 extern b oolean bfd_xcoff_import_symbol779 extern bfd_boolean bfd_xcoff_import_symbol 719 780 PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, 720 bfd_vma, const char *, const char *, const char *)); 721 extern boolean bfd_xcoff_export_symbol 722 PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, 723 boolean)); 724 extern boolean bfd_xcoff_link_count_reloc 781 bfd_vma, const char *, const char *, const char *, unsigned int)); 782 extern bfd_boolean bfd_xcoff_export_symbol 783 PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *)); 784 extern bfd_boolean bfd_xcoff_link_count_reloc 725 785 PARAMS ((bfd *, struct bfd_link_info *, const char *)); 726 extern b oolean bfd_xcoff_record_link_assignment786 extern bfd_boolean bfd_xcoff_record_link_assignment 727 787 PARAMS ((bfd *, struct bfd_link_info *, const char *)); 728 extern b oolean bfd_xcoff_size_dynamic_sections788 extern bfd_boolean bfd_xcoff_size_dynamic_sections 729 789 PARAMS ((bfd *, struct bfd_link_info *, const char *, const char *, 730 unsigned long, unsigned long, unsigned long, boolean, 731 int, boolean, boolean, struct sec **)); 790 unsigned long, unsigned long, unsigned long, bfd_boolean, 791 int, bfd_boolean, bfd_boolean, struct sec **, bfd_boolean)); 792 extern bfd_boolean bfd_xcoff_link_generate_rtinit 793 PARAMS ((bfd *, const char *, const char *, bfd_boolean)); 794 795 /* XCOFF support routines for ar. */ 796 extern bfd_boolean bfd_xcoff_ar_archive_set_magic 797 PARAMS ((bfd *, char *)); 732 798 733 799 /* Externally visible COFF routines. */ … … 738 804 #endif 739 805 740 extern b oolean bfd_coff_get_syment806 extern bfd_boolean bfd_coff_get_syment 741 807 PARAMS ((bfd *, struct symbol_cache_entry *, struct internal_syment *)); 742 808 743 extern b oolean bfd_coff_get_auxent809 extern bfd_boolean bfd_coff_get_auxent 744 810 PARAMS ((bfd *, struct symbol_cache_entry *, int, union internal_auxent *)); 745 811 746 extern b oolean bfd_coff_set_symbol_class812 extern bfd_boolean bfd_coff_set_symbol_class 747 813 PARAMS ((bfd *, struct symbol_cache_entry *, unsigned int)); 748 814 749 extern b oolean bfd_m68k_coff_create_embedded_relocs815 extern bfd_boolean bfd_m68k_coff_create_embedded_relocs 750 816 PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *, 751 817 char **)); 752 818 753 819 /* ARM Interworking support. Called from linker. */ 754 extern b oolean bfd_arm_allocate_interworking_sections820 extern bfd_boolean bfd_arm_allocate_interworking_sections 755 821 PARAMS ((struct bfd_link_info *)); 756 822 757 extern b oolean bfd_arm_process_before_allocation823 extern bfd_boolean bfd_arm_process_before_allocation 758 824 PARAMS ((bfd *, struct bfd_link_info *, int)); 759 825 760 extern b oolean bfd_arm_get_bfd_for_interworking826 extern bfd_boolean bfd_arm_get_bfd_for_interworking 761 827 PARAMS ((bfd *, struct bfd_link_info *)); 762 828 763 829 /* PE ARM Interworking support. Called from linker. */ 764 extern b oolean bfd_arm_pe_allocate_interworking_sections830 extern bfd_boolean bfd_arm_pe_allocate_interworking_sections 765 831 PARAMS ((struct bfd_link_info *)); 766 832 767 extern b oolean bfd_arm_pe_process_before_allocation833 extern bfd_boolean bfd_arm_pe_process_before_allocation 768 834 PARAMS ((bfd *, struct bfd_link_info *, int)); 769 835 770 extern b oolean bfd_arm_pe_get_bfd_for_interworking836 extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking 771 837 PARAMS ((bfd *, struct bfd_link_info *)); 772 838 773 839 /* ELF ARM Interworking support. Called from linker. */ 774 extern b oolean bfd_elf32_arm_allocate_interworking_sections840 extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections 775 841 PARAMS ((struct bfd_link_info *)); 776 842 777 extern b oolean bfd_elf32_arm_process_before_allocation843 extern bfd_boolean bfd_elf32_arm_process_before_allocation 778 844 PARAMS ((bfd *, struct bfd_link_info *, int)); 779 845 780 extern b oolean bfd_elf32_arm_get_bfd_for_interworking846 extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking 781 847 PARAMS ((bfd *, struct bfd_link_info *)); 848 849 extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd 850 PARAMS ((bfd *, struct bfd_link_info *)); 851 852 /* ARM Note section processing. */ 853 extern bfd_boolean bfd_arm_merge_machines 854 PARAMS ((bfd *, bfd *)); 855 856 extern bfd_boolean bfd_arm_update_notes 857 PARAMS ((bfd *, const char *)); 858 859 extern unsigned int bfd_arm_get_mach_from_notes 860 PARAMS ((bfd *, const char *)); 782 861 783 862 /* TI COFF load page support. */ … … 788 867 PARAMS ((struct sec *)); 789 868 790 /* And more from the source. */869 /* Extracted from init.c. */ 791 870 void 792 871 bfd_init PARAMS ((void)); 793 872 873 /* Extracted from opncls.c. */ 794 874 bfd * 795 bfd_openr PARAMS (( CONST char *filename, CONSTchar *target));875 bfd_openr PARAMS ((const char *filename, const char *target)); 796 876 797 877 bfd * 798 bfd_fdopenr PARAMS (( CONST char *filename, CONSTchar *target, int fd));878 bfd_fdopenr PARAMS ((const char *filename, const char *target, int fd)); 799 879 800 880 bfd * … … 802 882 803 883 bfd * 804 bfd_openw PARAMS (( CONST char *filename, CONSTchar *target));805 806 b oolean884 bfd_openw PARAMS ((const char *filename, const char *target)); 885 886 bfd_boolean 807 887 bfd_close PARAMS ((bfd *abfd)); 808 888 809 b oolean889 bfd_boolean 810 890 bfd_close_all_done PARAMS ((bfd *)); 811 891 812 892 bfd * 813 bfd_create PARAMS (( CONSTchar *filename, bfd *templ));814 815 b oolean893 bfd_create PARAMS ((const char *filename, bfd *templ)); 894 895 bfd_boolean 816 896 bfd_make_writable PARAMS ((bfd *abfd)); 817 897 818 b oolean898 bfd_boolean 819 899 bfd_make_readable PARAMS ((bfd *abfd)); 820 900 901 char * 902 bfd_follow_gnu_debuglink PARAMS ((bfd *abfd, const char *dir)); 903 904 /* Extracted from libbfd.c. */ 821 905 822 906 /* Byte swapping macros for user section data. */ … … 827 911 bfd_put_8 828 912 #define bfd_get_8(abfd, ptr) \ 829 (*(unsigned char *) (ptr) )913 (*(unsigned char *) (ptr) & 0xff) 830 914 #define bfd_get_signed_8(abfd, ptr) \ 831 (( *(unsigned char *) (ptr) ^ 0x80) - 0x80)915 (((*(unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) 832 916 833 917 #define bfd_put_16(abfd, val, ptr) \ … … 859 943 860 944 #define bfd_get(bits, abfd, ptr) \ 861 ( (bits) == 8 ? bfd_get_8 (abfd, ptr)\945 ( (bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \ 862 946 : (bits) == 16 ? bfd_get_16 (abfd, ptr) \ 863 947 : (bits) == 32 ? bfd_get_32 (abfd, ptr) \ … … 866 950 867 951 #define bfd_put(bits, abfd, val, ptr) \ 868 ( (bits) == 8 ? bfd_put_8 (abfd, val, ptr)\952 ( (bits) == 8 ? bfd_put_8 (abfd, val, ptr) \ 869 953 : (bits) == 16 ? bfd_put_16 (abfd, val, ptr) \ 870 954 : (bits) == 32 ? bfd_put_32 (abfd, val, ptr) \ … … 876 960 877 961 #define bfd_h_put_8(abfd, val, ptr) \ 878 962 bfd_put_8 (abfd, val, ptr) 879 963 #define bfd_h_put_signed_8(abfd, val, ptr) \ 880 964 bfd_put_8 (abfd, val, ptr) 881 965 #define bfd_h_get_8(abfd, ptr) \ 882 966 bfd_get_8 (abfd, ptr) 883 967 #define bfd_h_get_signed_8(abfd, ptr) \ 884 968 bfd_get_signed_8 (abfd, ptr) 885 969 886 970 #define bfd_h_put_16(abfd, val, ptr) \ 887 BFD_SEND(abfd, bfd_h_putx16,(val,ptr))971 BFD_SEND (abfd, bfd_h_putx16, (val, ptr)) 888 972 #define bfd_h_put_signed_16 \ 889 973 bfd_h_put_16 890 974 #define bfd_h_get_16(abfd, ptr) \ 891 BFD_SEND(abfd, bfd_h_getx16,(ptr))975 BFD_SEND (abfd, bfd_h_getx16, (ptr)) 892 976 #define bfd_h_get_signed_16(abfd, ptr) \ 893 BFD_SEND(abfd, bfd_h_getx_signed_16, (ptr))977 BFD_SEND (abfd, bfd_h_getx_signed_16, (ptr)) 894 978 895 979 #define bfd_h_put_32(abfd, val, ptr) \ 896 BFD_SEND(abfd, bfd_h_putx32,(val,ptr))980 BFD_SEND (abfd, bfd_h_putx32, (val, ptr)) 897 981 #define bfd_h_put_signed_32 \ 898 982 bfd_h_put_32 899 983 #define bfd_h_get_32(abfd, ptr) \ 900 BFD_SEND(abfd, bfd_h_getx32,(ptr))984 BFD_SEND (abfd, bfd_h_getx32, (ptr)) 901 985 #define bfd_h_get_signed_32(abfd, ptr) \ 902 BFD_SEND(abfd, bfd_h_getx_signed_32, (ptr))986 BFD_SEND (abfd, bfd_h_getx_signed_32, (ptr)) 903 987 904 988 #define bfd_h_put_64(abfd, val, ptr) \ 905 BFD_SEND(abfd, bfd_h_putx64,(val, ptr))989 BFD_SEND (abfd, bfd_h_putx64, (val, ptr)) 906 990 #define bfd_h_put_signed_64 \ 907 991 bfd_h_put_64 908 992 #define bfd_h_get_64(abfd, ptr) \ 909 BFD_SEND(abfd, bfd_h_getx64,(ptr))993 BFD_SEND (abfd, bfd_h_getx64, (ptr)) 910 994 #define bfd_h_get_signed_64(abfd, ptr) \ 911 BFD_SEND(abfd, bfd_h_getx_signed_64, (ptr)) 912 995 BFD_SEND (abfd, bfd_h_getx_signed_64, (ptr)) 996 997 /* Refinements on the above, which should eventually go away. Save 998 cluttering the source with (bfd_vma) and (bfd_byte *) casts. */ 999 1000 #define H_PUT_64(abfd, val, where) \ 1001 bfd_h_put_64 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) 1002 1003 #define H_PUT_32(abfd, val, where) \ 1004 bfd_h_put_32 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) 1005 1006 #define H_PUT_16(abfd, val, where) \ 1007 bfd_h_put_16 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) 1008 1009 #define H_PUT_8 bfd_h_put_8 1010 1011 #define H_PUT_S64(abfd, val, where) \ 1012 bfd_h_put_signed_64 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) 1013 1014 #define H_PUT_S32(abfd, val, where) \ 1015 bfd_h_put_signed_32 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) 1016 1017 #define H_PUT_S16(abfd, val, where) \ 1018 bfd_h_put_signed_16 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) 1019 1020 #define H_PUT_S8 bfd_h_put_signed_8 1021 1022 #define H_GET_64(abfd, where) \ 1023 bfd_h_get_64 ((abfd), (bfd_byte *) (where)) 1024 1025 #define H_GET_32(abfd, where) \ 1026 bfd_h_get_32 ((abfd), (bfd_byte *) (where)) 1027 1028 #define H_GET_16(abfd, where) \ 1029 bfd_h_get_16 ((abfd), (bfd_byte *) (where)) 1030 1031 #define H_GET_8 bfd_h_get_8 1032 1033 #define H_GET_S64(abfd, where) \ 1034 bfd_h_get_signed_64 ((abfd), (bfd_byte *) (where)) 1035 1036 #define H_GET_S32(abfd, where) \ 1037 bfd_h_get_signed_32 ((abfd), (bfd_byte *) (where)) 1038 1039 #define H_GET_S16(abfd, where) \ 1040 bfd_h_get_signed_16 ((abfd), (bfd_byte *) (where)) 1041 1042 #define H_GET_S8 bfd_h_get_signed_8 1043 1044 1045 /* Extracted from bfdio.c. */ 1046 long 1047 bfd_get_mtime PARAMS ((bfd *abfd)); 1048 1049 long 1050 bfd_get_size PARAMS ((bfd *abfd)); 1051 1052 /* Extracted from bfdwin.c. */ 1053 /* Extracted from section.c. */ 913 1054 /* This structure is used for a comdat section, as in PE. A comdat 914 1055 section is associated with a particular symbol. When the linker … … 932 1073 /* The name of the section; the name isn't a copy, the pointer is 933 1074 the same as that passed to bfd_make_section. */ 934 935 1075 const char *name; 936 1076 937 1077 /* A unique sequence number. */ 938 939 1078 int id; 940 1079 941 /* Which section is it; 0..nth. */ 942 1080 /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */ 943 1081 int index; 944 1082 945 1083 /* The next section in the list belonging to the BFD, or NULL. */ 946 947 1084 struct sec *next; 948 1085 … … 950 1087 flags are read in from the object file, and some are 951 1088 synthesized from other information. */ 952 953 1089 flagword flags; 954 1090 … … 967 1103 #define SEC_RELOC 0x004 968 1104 969 #if 0 /* Obsolete ? */ 970 #define SEC_BALIGN 0x008 971 #endif 1105 /* ELF reserves 4 processor specific bits and 8 operating system 1106 specific bits in sh_flags; at present we can get away with just 1107 one in communicating between the assembler and BFD, but this 1108 isn't a good long-term solution. */ 1109 #define SEC_ARCH_BIT_0 0x008 972 1110 973 1111 /* A signal to the OS that the section contains read only data. */ … … 995 1133 #define SEC_CONSTRUCTOR 0x100 996 1134 997 /* The section is a constructor, and should be placed at the998 end of the text, data, or bss section(?). */999 #define SEC_CONSTRUCTOR_TEXT 0x11001000 #define SEC_CONSTRUCTOR_DATA 0x21001001 #define SEC_CONSTRUCTOR_BSS 0x31001002 1003 1135 /* The section has contents - a data section could be 1004 1136 <<SEC_ALLOC>> | <<SEC_HAS_CONTENTS>>; a debug section could be … … 1021 1153 #define SEC_COFF_SHARED_LIBRARY 0x800 1022 1154 1155 /* The section contains thread local data. */ 1156 #define SEC_THREAD_LOCAL 0x1000 1157 1023 1158 /* The section has GOT references. This flag is only for the 1024 1159 linker, and is currently only used by the elf32-hppa back end. … … 1052 1187 #define SEC_EXCLUDE 0x40000 1053 1188 1054 /* The contents of this section are to be sorted by the 1055 based on the address specified in the associated symbol 1056 table. */ 1189 /* The contents of this section are to be sorted based on the sum of 1190 the symbol and addend values specified by the associated relocation 1191 entries. Entries without associated relocation entries will be 1192 appended to the end of the section in an unspecified order. */ 1057 1193 #define SEC_SORT_ENTRIES 0x80000 1058 1194 … … 1112 1248 #define SEC_CLINK 0x10000000 1113 1249 1250 /* Attempt to merge identical entities in the section. 1251 Entity size is given in the entsize field. */ 1252 #define SEC_MERGE 0x20000000 1253 1254 /* If given with SEC_MERGE, entities to merge are zero terminated 1255 strings where entsize specifies character size instead of fixed 1256 size entries. */ 1257 #define SEC_STRINGS 0x40000000 1258 1259 /* This section contains data about section groups. */ 1260 #define SEC_GROUP 0x80000000 1261 1114 1262 /* End of section flags. */ 1115 1263 … … 1126 1274 1127 1275 /* Another mark flag used by some of the linker backends. Set for 1128 output sections that have a input section. */1276 output sections that have an input section. */ 1129 1277 unsigned int linker_has_input : 1; 1130 1278 … … 1132 1280 unsigned int gc_mark : 1; 1133 1281 1134 /* Used by the ELF code to mark sections which have been allocated to segments. */ 1282 /* The following flags are used by the ELF linker. */ 1283 1284 /* Mark sections which have been allocated to segments. */ 1135 1285 unsigned int segment_mark : 1; 1286 1287 /* Type of sec_info information. */ 1288 unsigned int sec_info_type:3; 1289 #define ELF_INFO_TYPE_NONE 0 1290 #define ELF_INFO_TYPE_STABS 1 1291 #define ELF_INFO_TYPE_MERGE 2 1292 #define ELF_INFO_TYPE_EH_FRAME 3 1293 #define ELF_INFO_TYPE_JUST_SYMS 4 1294 1295 /* Nonzero if this section uses RELA relocations, rather than REL. */ 1296 unsigned int use_rela_p:1; 1297 1298 /* Bits used by various backends. */ 1299 unsigned int has_tls_reloc:1; 1300 1301 /* Nonzero if this section needs the relax finalize pass. */ 1302 unsigned int need_finalize_relax:1; 1303 1304 /* Usused bits. */ 1305 unsigned int flag12:1; 1306 unsigned int flag13:1; 1307 unsigned int flag14:1; 1308 unsigned int flag15:1; 1309 unsigned int flag16:4; 1310 unsigned int flag20:4; 1311 unsigned int flag24:8; 1136 1312 1137 1313 /* End of internal packed boolean fields. */ … … 1143 1319 the default address for <<.data>> is dependent on the specific 1144 1320 target and various flags). */ 1145 1146 1321 bfd_vma vma; 1147 1322 1148 1323 /* The load address of the section - where it would be in a 1149 1324 rom image; really only used for writing section header 1150 information. */ 1151 1325 information. */ 1152 1326 bfd_vma lma; 1153 1327 … … 1155 1329 Contains a value even if the section has no contents (e.g., the 1156 1330 size of <<.bss>>). This will be filled in after relocation. */ 1157 1158 1331 bfd_size_type _cooked_size; 1159 1332 … … 1161 1334 value is the same as the size, but if some relaxing has 1162 1335 been done, then this value will be bigger. */ 1163 1164 1336 bfd_size_type _raw_size; 1165 1337 … … 1171 1343 would be 100. However, if the target byte size is 16 bits 1172 1344 (bfd_octets_per_byte is "2"), this value would be 50. */ 1173 1174 1345 bfd_vma output_offset; 1175 1346 1176 1347 /* The output section through which to map on output. */ 1177 1178 1348 struct sec *output_section; 1179 1349 1180 1350 /* The alignment requirement of the section, as an exponent of 2 - 1181 1351 e.g., 3 aligns to 2^3 (or 8). */ 1182 1183 1352 unsigned int alignment_power; 1184 1353 1185 1354 /* If an input section, a pointer to a vector of relocation 1186 1355 records for the data in this section. */ 1187 1188 1356 struct reloc_cache_entry *relocation; 1189 1357 1190 1358 /* If an output section, a pointer to a vector of pointers to 1191 1359 relocation records for the data in this section. */ 1192 1193 1360 struct reloc_cache_entry **orelocation; 1194 1361 1195 /* The number of relocation records in one of the above */ 1196 1362 /* The number of relocation records in one of the above. */ 1197 1363 unsigned reloc_count; 1198 1364 … … 1201 1367 1202 1368 /* File position of section data. */ 1203 1204 1369 file_ptr filepos; 1205 1370 1206 1371 /* File position of relocation info. */ 1207 1208 1372 file_ptr rel_filepos; 1209 1373 1210 1374 /* File position of line data. */ 1211 1212 1375 file_ptr line_filepos; 1213 1376 1214 1377 /* Pointer to data for applications. */ 1215 1216 1378 PTR userdata; 1217 1379 … … 1221 1383 1222 1384 /* Attached line number information. */ 1223 1224 1385 alent *lineno; 1225 1386 1226 1387 /* Number of line number records. */ 1227 1228 1388 unsigned int lineno_count; 1229 1389 1390 /* Entity size for merging purposes. */ 1391 unsigned int entsize; 1392 1230 1393 /* Optional information about a COMDAT entry; NULL if not COMDAT. */ 1231 1232 1394 struct bfd_comdat_info *comdat; 1233 1234 /* Points to the kept section if this section is a link-once section,1235 and is discarded. */1236 struct sec *kept_section;1237 1395 1238 1396 /* When a section is being output, this value changes as more 1239 1397 linenumbers are written out. */ 1240 1241 1398 file_ptr moving_line_filepos; 1242 1399 1243 1400 /* What the section number is in the target world. */ 1244 1245 1401 int target_index; 1246 1402 … … 1249 1405 /* If this is a constructor section then here is a list of the 1250 1406 relocations created to relocate items within it. */ 1251 1252 1407 struct relent_chain *constructor_chain; 1253 1408 1254 1409 /* The BFD which owns the section. */ 1255 1256 1410 bfd *owner; 1257 1411 1258 /* A symbol which points at this section only */1412 /* A symbol which points at this section only. */ 1259 1413 struct symbol_cache_entry *symbol; 1260 1414 struct symbol_cache_entry **symbol_ptr_ptr; … … 1262 1416 struct bfd_link_order *link_order_head; 1263 1417 struct bfd_link_order *link_order_tail; 1264 } asection 1418 } asection; 1265 1419 1266 1420 /* These sections are global, and are managed by BFD. The application … … 1274 1428 #define BFD_IND_SECTION_NAME "*IND*" 1275 1429 1276 /* the absolute section*/1430 /* The absolute section. */ 1277 1431 extern const asection bfd_abs_section; 1278 1432 #define bfd_abs_section_ptr ((asection *) &bfd_abs_section) 1279 1433 #define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr) 1280 /* Pointer to the undefined section */1434 /* Pointer to the undefined section. */ 1281 1435 extern const asection bfd_und_section; 1282 1436 #define bfd_und_section_ptr ((asection *) &bfd_und_section) 1283 1437 #define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr) 1284 /* Pointer to the common section */1438 /* Pointer to the common section. */ 1285 1439 extern const asection bfd_com_section; 1286 1440 #define bfd_com_section_ptr ((asection *) &bfd_com_section) 1287 /* Pointer to the indirect section */1441 /* Pointer to the indirect section. */ 1288 1442 extern const asection bfd_ind_section; 1289 1443 #define bfd_ind_section_ptr ((asection *) &bfd_ind_section) 1290 1444 #define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr) 1445 1446 #define bfd_is_const_section(SEC) \ 1447 ( ((SEC) == bfd_abs_section_ptr) \ 1448 || ((SEC) == bfd_und_section_ptr) \ 1449 || ((SEC) == bfd_com_section_ptr) \ 1450 || ((SEC) == bfd_ind_section_ptr)) 1291 1451 1292 1452 extern const struct symbol_cache_entry * const bfd_abs_symbol; … … 1300 1460 ((section)->reloc_done ? (section)->_cooked_size \ 1301 1461 : (abort (), (bfd_size_type) 1)) 1462 1463 /* Macros to handle insertion and deletion of a bfd's sections. These 1464 only handle the list pointers, ie. do not adjust section_count, 1465 target_index etc. */ 1466 #define bfd_section_list_remove(ABFD, PS) \ 1467 do \ 1468 { \ 1469 asection **_ps = PS; \ 1470 asection *_s = *_ps; \ 1471 *_ps = _s->next; \ 1472 if (_s->next == NULL) \ 1473 (ABFD)->section_tail = _ps; \ 1474 } \ 1475 while (0) 1476 #define bfd_section_list_insert(ABFD, PS, S) \ 1477 do \ 1478 { \ 1479 asection **_ps = PS; \ 1480 asection *_s = S; \ 1481 _s->next = *_ps; \ 1482 *_ps = _s; \ 1483 if (_s->next == NULL) \ 1484 (ABFD)->section_tail = &_s->next; \ 1485 } \ 1486 while (0) 1487 1488 void 1489 bfd_section_list_clear PARAMS ((bfd *)); 1490 1302 1491 asection * 1303 1492 bfd_get_section_by_name PARAMS ((bfd *abfd, const char *name)); … … 1317 1506 bfd_make_section PARAMS ((bfd *, const char *name)); 1318 1507 1319 b oolean1508 bfd_boolean 1320 1509 bfd_set_section_flags PARAMS ((bfd *abfd, asection *sec, flagword flags)); 1321 1510 … … 1327 1516 PTR obj)); 1328 1517 1329 b oolean1518 bfd_boolean 1330 1519 bfd_set_section_size PARAMS ((bfd *abfd, asection *sec, bfd_size_type val)); 1331 1520 1332 boolean 1333 bfd_set_section_contents PARAMS ((bfd *abfd, 1334 asection *section, 1335 PTR data, 1336 file_ptr offset, 1521 bfd_boolean 1522 bfd_set_section_contents PARAMS ((bfd *abfd, asection *section, 1523 PTR data, file_ptr offset, 1337 1524 bfd_size_type count)); 1338 1525 1339 boolean 1340 bfd_get_section_contents PARAMS ((bfd *abfd, asection *section, PTR location, 1341 file_ptr offset, bfd_size_type count)); 1342 1343 boolean 1344 bfd_copy_private_section_data PARAMS ((bfd *ibfd, asection *isec, bfd *obfd, asection *osec)); 1526 bfd_boolean 1527 bfd_get_section_contents PARAMS ((bfd *abfd, asection *section, 1528 PTR location, file_ptr offset, 1529 bfd_size_type count)); 1530 1531 bfd_boolean 1532 bfd_copy_private_section_data PARAMS ((bfd *ibfd, asection *isec, 1533 bfd *obfd, asection *osec)); 1345 1534 1346 1535 #define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \ … … 1350 1539 _bfd_strip_section_from_output PARAMS ((struct bfd_link_info *info, asection *section)); 1351 1540 1541 bfd_boolean 1542 bfd_generic_discard_group PARAMS ((bfd *abfd, asection *group)); 1543 1544 /* Extracted from archures.c. */ 1352 1545 enum bfd_architecture 1353 1546 { 1354 bfd_arch_unknown, /* File arch not known */1355 bfd_arch_obscure, /* Arch known, not one of these */1547 bfd_arch_unknown, /* File arch not known. */ 1548 bfd_arch_obscure, /* Arch known, not one of these. */ 1356 1549 bfd_arch_m68k, /* Motorola 68xxx */ 1357 1550 #define bfd_mach_m68000 1 … … 1375 1568 The exception is the "ca", which is 1376 1569 incompatible with all other machines except 1377 "core". */1570 "core". */ 1378 1571 1379 1572 #define bfd_mach_i960_core 1 … … 1386 1579 #define bfd_mach_i960_hx 8 1387 1580 1581 bfd_arch_or32, /* OpenRISC 32 */ 1582 1388 1583 bfd_arch_a29k, /* AMD 29000 */ 1389 1584 bfd_arch_sparc, /* SPARC */ … … 1393 1588 #define bfd_mach_sparc_sparclite 3 1394 1589 #define bfd_mach_sparc_v8plus 4 1395 #define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns */1590 #define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns. */ 1396 1591 #define bfd_mach_sparc_sparclite_le 6 1397 1592 #define bfd_mach_sparc_v9 7 1398 #define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns */1399 #define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns */1400 #define bfd_mach_sparc_v9b 10 /* with cheetah add'ns */1593 #define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */ 1594 #define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */ 1595 #define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */ 1401 1596 /* Nonzero if MACH has the v9 instruction set. */ 1402 1597 #define bfd_mach_sparc_v9_p(mach) \ … … 1410 1605 #define bfd_mach_mips4100 4100 1411 1606 #define bfd_mach_mips4111 4111 1607 #define bfd_mach_mips4120 4120 1412 1608 #define bfd_mach_mips4300 4300 1413 1609 #define bfd_mach_mips4400 4400 … … 1415 1611 #define bfd_mach_mips4650 4650 1416 1612 #define bfd_mach_mips5000 5000 1613 #define bfd_mach_mips5400 5400 1614 #define bfd_mach_mips5500 5500 1417 1615 #define bfd_mach_mips6000 6000 1418 1616 #define bfd_mach_mips8000 8000 … … 1420 1618 #define bfd_mach_mips12000 12000 1421 1619 #define bfd_mach_mips16 16 1422 #define bfd_mach_mips32 321423 #define bfd_mach_mips32_4k 3204113 /* 32, 04, octal 'K' */1424 1620 #define bfd_mach_mips5 5 1425 #define bfd_mach_mips64 641426 1621 #define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */ 1622 #define bfd_mach_mipsisa32 32 1623 #define bfd_mach_mipsisa32r2 33 1624 #define bfd_mach_mipsisa64 64 1427 1625 bfd_arch_i386, /* Intel 386 */ 1428 #define bfd_mach_i386_i386 01429 #define bfd_mach_i386_i8086 11430 #define bfd_mach_i386_i386_intel_syntax 21431 #define bfd_mach_x86_64 31432 #define bfd_mach_x86_64_intel_syntax 41626 #define bfd_mach_i386_i386 1 1627 #define bfd_mach_i386_i8086 2 1628 #define bfd_mach_i386_i386_intel_syntax 3 1629 #define bfd_mach_x86_64 64 1630 #define bfd_mach_x86_64_intel_syntax 65 1433 1631 bfd_arch_we32k, /* AT&T WE32xxx */ 1434 1632 bfd_arch_tahoe, /* CCI/Harris Tahoe */ … … 1439 1637 bfd_arch_convex, /* Convex */ 1440 1638 bfd_arch_m88k, /* Motorola 88xxx */ 1639 bfd_arch_m98k, /* Motorola 98xxx */ 1441 1640 bfd_arch_pyramid, /* Pyramid Technology */ 1442 bfd_arch_h8300, /* Hitachi H8/300 */ 1443 #define bfd_mach_h8300 1 1444 #define bfd_mach_h8300h 2 1445 #define bfd_mach_h8300s 3 1641 bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300) */ 1642 #define bfd_mach_h8300 1 1643 #define bfd_mach_h8300h 2 1644 #define bfd_mach_h8300s 3 1645 #define bfd_mach_h8300hn 4 1646 #define bfd_mach_h8300sn 5 1647 bfd_arch_pdp11, /* DEC PDP-11 */ 1446 1648 bfd_arch_powerpc, /* PowerPC */ 1447 #define bfd_mach_ppc 0 1649 #define bfd_mach_ppc 32 1650 #define bfd_mach_ppc64 64 1448 1651 #define bfd_mach_ppc_403 403 1449 1652 #define bfd_mach_ppc_403gc 4030 … … 1462 1665 #define bfd_mach_ppc_rs64iii 643 1463 1666 #define bfd_mach_ppc_7400 7400 1667 #define bfd_mach_ppc_e500 500 1464 1668 bfd_arch_rs6000, /* IBM RS/6000 */ 1465 #define bfd_mach_rs6k 01669 #define bfd_mach_rs6k 6000 1466 1670 #define bfd_mach_rs6k_rs1 6001 1467 1671 #define bfd_mach_rs6k_rsc 6003 … … 1469 1673 bfd_arch_hppa, /* HP PA RISC */ 1470 1674 bfd_arch_d10v, /* Mitsubishi D10V */ 1471 #define bfd_mach_d10v 01675 #define bfd_mach_d10v 1 1472 1676 #define bfd_mach_d10v_ts2 2 1473 1677 #define bfd_mach_d10v_ts3 3 1474 1678 bfd_arch_d30v, /* Mitsubishi D30V */ 1679 bfd_arch_dlx, /* DLX */ 1475 1680 bfd_arch_m68hc11, /* Motorola 68HC11 */ 1476 1681 bfd_arch_m68hc12, /* Motorola 68HC12 */ 1682 #define bfd_mach_m6812_default 0 1683 #define bfd_mach_m6812 1 1684 #define bfd_mach_m6812s 2 1477 1685 bfd_arch_z8k, /* Zilog Z8000 */ 1478 1686 #define bfd_mach_z8001 1 1479 1687 #define bfd_mach_z8002 2 1480 bfd_arch_h8500, /* Hitachi H8/500*/1481 bfd_arch_sh, /* Hitachi SH*/1482 #define bfd_mach_sh 01688 bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500) */ 1689 bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH) */ 1690 #define bfd_mach_sh 1 1483 1691 #define bfd_mach_sh2 0x20 1484 1692 #define bfd_mach_sh_dsp 0x2d 1693 #define bfd_mach_sh2e 0x2e 1485 1694 #define bfd_mach_sh3 0x30 1486 1695 #define bfd_mach_sh3_dsp 0x3d 1487 1696 #define bfd_mach_sh3e 0x3e 1488 1697 #define bfd_mach_sh4 0x40 1698 #define bfd_mach_sh5 0x50 1489 1699 bfd_arch_alpha, /* Dec Alpha */ 1490 1700 #define bfd_mach_alpha_ev4 0x10 1491 1701 #define bfd_mach_alpha_ev5 0x20 1492 1702 #define bfd_mach_alpha_ev6 0x30 1493 bfd_arch_arm, /* Advanced Risc Machines ARM */ 1703 bfd_arch_arm, /* Advanced Risc Machines ARM. */ 1704 #define bfd_mach_arm_unknown 0 1494 1705 #define bfd_mach_arm_2 1 1495 1706 #define bfd_mach_arm_2a 2 … … 1502 1713 #define bfd_mach_arm_5TE 9 1503 1714 #define bfd_mach_arm_XScale 10 1715 #define bfd_mach_arm_ep9312 11 1716 #define bfd_mach_arm_iWMMXt 12 1504 1717 bfd_arch_ns32k, /* National Semiconductors ns32000 */ 1505 1718 bfd_arch_w65, /* WDC 65816 */ 1506 1719 bfd_arch_tic30, /* Texas Instruments TMS320C30 */ 1720 bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */ 1721 #define bfd_mach_tic3x 30 1722 #define bfd_mach_tic4x 40 1507 1723 bfd_arch_tic54x, /* Texas Instruments TMS320C54X */ 1508 1724 bfd_arch_tic80, /* TI TMS320c80 (MVP) */ 1509 1725 bfd_arch_v850, /* NEC V850 */ 1510 #define bfd_mach_v850 01726 #define bfd_mach_v850 1 1511 1727 #define bfd_mach_v850e 'E' 1512 #define bfd_mach_v850ea 'A'1513 1728 bfd_arch_arc, /* ARC Cores */ 1514 #define bfd_mach_arc_5 01515 #define bfd_mach_arc_6 11516 #define bfd_mach_arc_7 21517 #define bfd_mach_arc_8 31518 bfd_arch_m32r, /* Mitsubishi M32R/D*/1519 #define bfd_mach_m32r 0 /* backwards compatibility*/1729 #define bfd_mach_arc_5 5 1730 #define bfd_mach_arc_6 6 1731 #define bfd_mach_arc_7 7 1732 #define bfd_mach_arc_8 8 1733 bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D) */ 1734 #define bfd_mach_m32r 1 /* For backwards compatibility. */ 1520 1735 #define bfd_mach_m32rx 'x' 1521 1736 bfd_arch_mn10200, /* Matsushita MN10200 */ … … 1525 1740 bfd_arch_fr30, 1526 1741 #define bfd_mach_fr30 0x46523330 1742 bfd_arch_frv, 1743 #define bfd_mach_frv 1 1744 #define bfd_mach_frvsimple 2 1745 #define bfd_mach_fr300 300 1746 #define bfd_mach_fr400 400 1747 #define bfd_mach_frvtomcat 499 /* fr500 prototype */ 1748 #define bfd_mach_fr500 500 1527 1749 bfd_arch_mcore, 1528 1750 bfd_arch_ia64, /* HP/Intel ia64 */ 1529 #define bfd_mach_ia64_elf64 0 1530 #define bfd_mach_ia64_elf32 1 1751 #define bfd_mach_ia64_elf64 64 1752 #define bfd_mach_ia64_elf32 32 1753 bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */ 1754 #define bfd_mach_ip2022 1 1755 #define bfd_mach_ip2022ext 2 1756 bfd_arch_iq2000, /* Vitesse IQ2000. */ 1757 #define bfd_mach_iq2000 1 1758 #define bfd_mach_iq10 2 1531 1759 bfd_arch_pj, 1532 bfd_arch_avr, /* Atmel AVR microcontrollers */1760 bfd_arch_avr, /* Atmel AVR microcontrollers. */ 1533 1761 #define bfd_mach_avr1 1 1534 1762 #define bfd_mach_avr2 2 … … 1537 1765 #define bfd_mach_avr5 5 1538 1766 bfd_arch_cris, /* Axis CRIS */ 1767 bfd_arch_s390, /* IBM s390 */ 1768 #define bfd_mach_s390_31 31 1769 #define bfd_mach_s390_64 64 1770 bfd_arch_openrisc, /* OpenRISC */ 1771 bfd_arch_mmix, /* Donald Knuth's educational processor. */ 1772 bfd_arch_xstormy16, 1773 #define bfd_mach_xstormy16 1 1774 bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */ 1775 #define bfd_mach_msp110 110 1776 #define bfd_mach_msp11 11 1777 #define bfd_mach_msp12 12 1778 #define bfd_mach_msp13 13 1779 #define bfd_mach_msp14 14 1780 #define bfd_mach_msp41 41 1781 #define bfd_mach_msp31 31 1782 #define bfd_mach_msp32 32 1783 #define bfd_mach_msp33 33 1784 #define bfd_mach_msp43 43 1785 #define bfd_mach_msp44 44 1786 #define bfd_mach_msp15 15 1787 #define bfd_mach_msp16 16 1788 bfd_arch_xtensa, /* Tensilica's Xtensa cores. */ 1789 #define bfd_mach_xtensa 1 1539 1790 bfd_arch_last 1540 1791 }; … … 1550 1801 const char *printable_name; 1551 1802 unsigned int section_align_power; 1552 /* True if this is the default machine for the architecture. */ 1553 boolean the_default; 1803 /* TRUE if this is the default machine for the architecture. 1804 The default arch should be the first entry for an arch so that 1805 all the entries for that arch can be accessed via <<next>>. */ 1806 bfd_boolean the_default; 1554 1807 const struct bfd_arch_info * (*compatible) 1555 1808 PARAMS ((const struct bfd_arch_info *a, 1556 1809 const struct bfd_arch_info *b)); 1557 1810 1558 b oolean (*scan) PARAMS ((const struct bfd_arch_info *, const char *));1811 bfd_boolean (*scan) PARAMS ((const struct bfd_arch_info *, const char *)); 1559 1812 1560 1813 const struct bfd_arch_info *next; 1561 } bfd_arch_info_type; 1814 } 1815 bfd_arch_info_type; 1816 1562 1817 const char * 1563 1818 bfd_printable_name PARAMS ((bfd *abfd)); … … 1572 1827 bfd_arch_get_compatible PARAMS (( 1573 1828 const bfd *abfd, 1574 const bfd *bbfd)); 1829 const bfd *bbfd, 1830 bfd_boolean accept_unknowns)); 1575 1831 1576 1832 void … … 1607 1863 unsigned long machine)); 1608 1864 1865 /* Extracted from reloc.c. */ 1609 1866 typedef enum bfd_reloc_status 1610 1867 { 1611 /* No errors detected*/1868 /* No errors detected. */ 1612 1869 bfd_reloc_ok, 1613 1870 1614 /* The relocation was performed, but there was an overflow.*/1871 /* The relocation was performed, but there was an overflow. */ 1615 1872 bfd_reloc_overflow, 1616 1873 1617 /* The address to relocate was not within the section supplied.*/1874 /* The address to relocate was not within the section supplied. */ 1618 1875 bfd_reloc_outofrange, 1619 1876 1620 /* Used by special functions*/1877 /* Used by special functions. */ 1621 1878 bfd_reloc_continue, 1622 1879 1623 /* Unsupported relocation size requested.*/1880 /* Unsupported relocation size requested. */ 1624 1881 bfd_reloc_notsupported, 1625 1882 1626 /* Unused*/1883 /* Unused. */ 1627 1884 bfd_reloc_other, 1628 1885 1629 /* The symbol to relocate against was undefined.*/1886 /* The symbol to relocate against was undefined. */ 1630 1887 bfd_reloc_undefined, 1631 1888 1632 1633 1634 1635 1889 /* The relocation was performed, but may not be ok - presently 1890 generated only when linking i960 coff files with i960 b.out 1891 symbols. If this type is returned, the error_message argument 1892 to bfd_perform_relocation will be set. */ 1636 1893 bfd_reloc_dangerous 1637 1894 } … … 1641 1898 typedef struct reloc_cache_entry 1642 1899 { 1643 /* A pointer into the canonical table of pointers*/1900 /* A pointer into the canonical table of pointers. */ 1644 1901 struct symbol_cache_entry **sym_ptr_ptr; 1645 1902 1646 /* offset in section*/1903 /* offset in section. */ 1647 1904 bfd_size_type address; 1648 1905 1649 /* addend for relocation value*/1906 /* addend for relocation value. */ 1650 1907 bfd_vma addend; 1651 1908 1652 /* Pointer to how to perform the required relocation*/1909 /* Pointer to how to perform the required relocation. */ 1653 1910 reloc_howto_type *howto; 1654 1911 1655 } arelent; 1912 } 1913 arelent; 1914 1656 1915 enum complain_overflow 1657 1916 { 1658 /* Do not complain on overflow.*/1917 /* Do not complain on overflow. */ 1659 1918 complain_overflow_dont, 1660 1919 1661 1662 as signed or unsigned.*/1920 /* Complain if the bitfield overflows, whether it is considered 1921 as signed or unsigned. */ 1663 1922 complain_overflow_bitfield, 1664 1923 1665 1666 number.*/1924 /* Complain if the value overflows when considered as signed 1925 number. */ 1667 1926 complain_overflow_signed, 1668 1927 1669 1670 unsigned number.*/1928 /* Complain if the value overflows when considered as an 1929 unsigned number. */ 1671 1930 complain_overflow_unsigned 1672 1931 }; … … 1674 1933 struct reloc_howto_struct 1675 1934 { 1676 1677 1678 1679 in this field.For example, a PC relative word relocation1680 1681 what the outside world calls a R_PCRWORD reloc.*/1935 /* The type field has mainly a documentary use - the back end can 1936 do what it wants with it, though normally the back end's 1937 external idea of what a reloc number is stored 1938 in this field. For example, a PC relative word relocation 1939 in a coff environment has the type 023 - because that's 1940 what the outside world calls a R_PCRWORD reloc. */ 1682 1941 unsigned int type; 1683 1942 1684 /* The value the final relocation is shifted right by.This drops1685 1943 /* The value the final relocation is shifted right by. This drops 1944 unwanted data from the relocation. */ 1686 1945 unsigned int rightshift; 1687 1946 1688 1689 1690 1947 /* The size of the item to be relocated. This is *not* a 1948 power-of-two measure. To get the number of bytes operated 1949 on by a type of relocation, use bfd_get_reloc_size. */ 1691 1950 int size; 1692 1951 1693 1694 1952 /* The number of bits in the item to be relocated. This is used 1953 when doing overflow checking. */ 1695 1954 unsigned int bitsize; 1696 1955 1697 1698 data section of the addend.The relocation function will1699 1700 being relocated.*/1701 b oolean pc_relative;1702 1703 1704 The relocated value is left shifted by this amount.*/1956 /* Notes that the relocation is relative to the location in the 1957 data section of the addend. The relocation function will 1958 subtract from the relocation value the address of the location 1959 being relocated. */ 1960 bfd_boolean pc_relative; 1961 1962 /* The bit position of the reloc value in the destination. 1963 The relocated value is left shifted by this amount. */ 1705 1964 unsigned int bitpos; 1706 1965 1707 1708 relocating.*/1966 /* What type of overflow error should be checked for when 1967 relocating. */ 1709 1968 enum complain_overflow complain_on_overflow; 1710 1969 1711 1712 called rather than the normal function.This allows really1713 1714 instructions).*/1970 /* If this field is non null, then the supplied function is 1971 called rather than the normal function. This allows really 1972 strange relocation methods to be accomodated (e.g., i960 callj 1973 instructions). */ 1715 1974 bfd_reloc_status_type (*special_function) 1716 PARAMS ((bfd *abfd, 1717 arelent *reloc_entry, 1718 struct symbol_cache_entry *symbol, 1719 PTR data, 1720 asection *input_section, 1721 bfd *output_bfd, 1722 char **error_message)); 1723 1724 /* The textual name of the relocation type. */ 1975 PARAMS ((bfd *, arelent *, struct symbol_cache_entry *, PTR, asection *, 1976 bfd *, char **)); 1977 1978 /* The textual name of the relocation type. */ 1725 1979 char *name; 1726 1980 1727 /* Some formats record a relocation addend in the section contents 1728 rather than with the relocation. For ELF formats this is the 1729 distinction between USE_REL and USE_RELA (though the code checks 1730 for USE_REL == 1/0). The value of this field is TRUE if the 1731 addend is recorded with the section contents; when performing a 1732 partial link (ld -r) the section contents (the data) will be 1733 modified. The value of this field is FALSE if addends are 1734 recorded with the relocation (in arelent.addend); when performing 1735 a partial link the relocation will be modified. 1736 All relocations for all ELF USE_RELA targets should set this field 1737 to FALSE (values of TRUE should be looked on with suspicion). 1738 However, the converse is not true: not all relocations of all ELF 1739 USE_REL targets set this field to TRUE. Why this is so is peculiar 1740 to each particular target. For relocs that aren't used in partial 1741 links (e.g. GOT stuff) it doesn't matter what this is set to. */ 1742 boolean partial_inplace; 1743 1744 /* The src_mask selects which parts of the read in data 1745 are to be used in the relocation sum. E.g., if this was an 8 bit 1746 byte of data which we read and relocated, this would be 1747 0x000000ff. When we have relocs which have an addend, such as 1748 sun4 extended relocs, the value in the offset part of a 1749 relocating field is garbage so we never use it. In this case 1750 the mask would be 0x00000000. */ 1981 /* Some formats record a relocation addend in the section contents 1982 rather than with the relocation. For ELF formats this is the 1983 distinction between USE_REL and USE_RELA (though the code checks 1984 for USE_REL == 1/0). The value of this field is TRUE if the 1985 addend is recorded with the section contents; when performing a 1986 partial link (ld -r) the section contents (the data) will be 1987 modified. The value of this field is FALSE if addends are 1988 recorded with the relocation (in arelent.addend); when performing 1989 a partial link the relocation will be modified. 1990 All relocations for all ELF USE_RELA targets should set this field 1991 to FALSE (values of TRUE should be looked on with suspicion). 1992 However, the converse is not true: not all relocations of all ELF 1993 USE_REL targets set this field to TRUE. Why this is so is peculiar 1994 to each particular target. For relocs that aren't used in partial 1995 links (e.g. GOT stuff) it doesn't matter what this is set to. */ 1996 bfd_boolean partial_inplace; 1997 1998 /* src_mask selects the part of the instruction (or data) to be used 1999 in the relocation sum. If the target relocations don't have an 2000 addend in the reloc, eg. ELF USE_REL, src_mask will normally equal 2001 dst_mask to extract the addend from the section contents. If 2002 relocations do have an addend in the reloc, eg. ELF USE_RELA, this 2003 field should be zero. Non-zero values for ELF USE_RELA targets are 2004 bogus as in those cases the value in the dst_mask part of the 2005 section contents should be treated as garbage. */ 1751 2006 bfd_vma src_mask; 1752 2007 1753 /* The dst_mask selects which parts of the instruction are replaced 1754 into the instruction. In most cases src_mask == dst_mask, 1755 except in the above special case, where dst_mask would be 1756 0x000000ff, and src_mask would be 0x00000000. */ 2008 /* dst_mask selects which parts of the instruction (or data) are 2009 replaced with a relocated value. */ 1757 2010 bfd_vma dst_mask; 1758 2011 1759 /* When some formats create PC relative instructions, they leave 1760 the value of the pc of the place being relocated in the offset 1761 slot of the instruction, so that a PC relative relocation can 1762 be made just by adding in an ordinary offset (e.g., sun3 a.out). 1763 Some formats leave the displacement part of an instruction 1764 empty (e.g., m88k bcs); this flag signals the fact.*/ 1765 boolean pcrel_offset; 1766 2012 /* When some formats create PC relative instructions, they leave 2013 the value of the pc of the place being relocated in the offset 2014 slot of the instruction, so that a PC relative relocation can 2015 be made just by adding in an ordinary offset (e.g., sun3 a.out). 2016 Some formats leave the displacement part of an instruction 2017 empty (e.g., m88k bcs); this flag signals the fact. */ 2018 bfd_boolean pcrel_offset; 1767 2019 }; 1768 #define HOWTO(C, R,S,B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \ 1769 {(unsigned)C,R,S,B, P, BI, O,SF,NAME,INPLACE,MASKSRC,MASKDST,PC} 1770 #define NEWHOWTO( FUNCTION, NAME,SIZE,REL,IN) HOWTO(0,0,SIZE,0,REL,0,complain_overflow_dont,FUNCTION, NAME,false,0,0,IN) 2020 2021 #define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \ 2022 { (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC } 2023 #define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \ 2024 HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \ 2025 NAME, FALSE, 0, 0, IN) 1771 2026 1772 2027 #define EMPTY_HOWTO(C) \ 1773 HOWTO((C),0,0,0,false,0,complain_overflow_dont,NULL,NULL,false,0,0,false) 1774 1775 #define HOWTO_PREPARE(relocation, symbol) \ 1776 { \ 1777 if (symbol != (asymbol *)NULL) { \ 1778 if (bfd_is_com_section (symbol->section)) { \ 1779 relocation = 0; \ 1780 } \ 1781 else { \ 1782 relocation = symbol->value; \ 1783 } \ 1784 } \ 1785 } 2028 HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \ 2029 NULL, FALSE, 0, 0, FALSE) 2030 2031 #define HOWTO_PREPARE(relocation, symbol) \ 2032 { \ 2033 if (symbol != (asymbol *) NULL) \ 2034 { \ 2035 if (bfd_is_com_section (symbol->section)) \ 2036 { \ 2037 relocation = 0; \ 2038 } \ 2039 else \ 2040 { \ 2041 relocation = symbol->value; \ 2042 } \ 2043 } \ 2044 } 2045 1786 2046 unsigned int 1787 2047 bfd_get_reloc_size PARAMS ((reloc_howto_type *)); 1788 2048 1789 typedef struct relent_chain { 2049 typedef struct relent_chain 2050 { 1790 2051 arelent relent; 1791 struct relent_chain *next; 1792 } arelent_chain; 2052 struct relent_chain *next; 2053 } 2054 arelent_chain; 2055 1793 2056 bfd_reloc_status_type 1794 2057 bfd_check_overflow PARAMS ((enum complain_overflow how, … … 1817 2080 1818 2081 1819 /* Basic absolute relocations of N bits. */2082 /* Basic absolute relocations of N bits. */ 1820 2083 BFD_RELOC_64, 1821 2084 BFD_RELOC_32, … … 1830 2093 the section containing the relocation. It depends on the specific target. 1831 2094 1832 The 24-bit relocation is used in some Intel 960 configurations. */2095 The 24-bit relocation is used in some Intel 960 configurations. */ 1833 2096 BFD_RELOC_64_PCREL, 1834 2097 BFD_RELOC_32_PCREL, … … 1838 2101 BFD_RELOC_8_PCREL, 1839 2102 1840 /* For ELF. */2103 /* For ELF. */ 1841 2104 BFD_RELOC_32_GOT_PCREL, 1842 2105 BFD_RELOC_16_GOT_PCREL, … … 1848 2111 BFD_RELOC_HI16_S_GOTOFF, 1849 2112 BFD_RELOC_8_GOTOFF, 2113 BFD_RELOC_64_PLT_PCREL, 1850 2114 BFD_RELOC_32_PLT_PCREL, 1851 2115 BFD_RELOC_24_PLT_PCREL, 1852 2116 BFD_RELOC_16_PLT_PCREL, 1853 2117 BFD_RELOC_8_PLT_PCREL, 2118 BFD_RELOC_64_PLTOFF, 1854 2119 BFD_RELOC_32_PLTOFF, 1855 2120 BFD_RELOC_16_PLTOFF, … … 1859 2124 BFD_RELOC_8_PLTOFF, 1860 2125 1861 /* Relocations used by 68K ELF. */2126 /* Relocations used by 68K ELF. */ 1862 2127 BFD_RELOC_68K_GLOB_DAT, 1863 2128 BFD_RELOC_68K_JMP_SLOT, 1864 2129 BFD_RELOC_68K_RELATIVE, 1865 2130 1866 /* Linkage-table relative. */2131 /* Linkage-table relative. */ 1867 2132 BFD_RELOC_32_BASEREL, 1868 2133 BFD_RELOC_16_BASEREL, … … 1873 2138 BFD_RELOC_RVA, 1874 2139 1875 /* Absolute 8-bit relocation, but used to form an address like 0xFFnn. */2140 /* Absolute 8-bit relocation, but used to form an address like 0xFFnn. */ 1876 2141 BFD_RELOC_8_FFnn, 1877 2142 … … 1881 2146 SPARC. (SPARC tools generally refer to this as <<WDISP30>>.) The 1882 2147 signed 16-bit displacement is used on the MIPS, and the 23-bit 1883 displacement is used on the Alpha. */2148 displacement is used on the Alpha. */ 1884 2149 BFD_RELOC_32_PCREL_S2, 1885 2150 BFD_RELOC_16_PCREL_S2, … … 1887 2152 1888 2153 /* High 22 bits and low 10 bits of 32-bit value, placed into lower bits of 1889 the target word. These are used on the SPARC. */2154 the target word. These are used on the SPARC. */ 1890 2155 BFD_RELOC_HI22, 1891 2156 BFD_RELOC_LO10, … … 1894 2159 displacements off that register. These relocation types are 1895 2160 handled specially, because the value the register will have is 1896 decided relatively late. */2161 decided relatively late. */ 1897 2162 BFD_RELOC_GPREL16, 1898 2163 BFD_RELOC_GPREL32, 1899 2164 1900 /* Reloc types used for i960/b.out. */2165 /* Reloc types used for i960/b.out. */ 1901 2166 BFD_RELOC_I960_CALLJ, 1902 2167 1903 2168 /* SPARC ELF relocations. There is probably some overlap with other 1904 relocation types already defined. */2169 relocation types already defined. */ 1905 2170 BFD_RELOC_NONE, 1906 2171 BFD_RELOC_SPARC_WDISP22, … … 1921 2186 BFD_RELOC_SPARC_UA64, 1922 2187 1923 /* I think these are specific to SPARC a.out (e.g., Sun 4). */2188 /* I think these are specific to SPARC a.out (e.g., Sun 4). */ 1924 2189 BFD_RELOC_SPARC_BASE13, 1925 2190 BFD_RELOC_SPARC_BASE22, 1926 2191 1927 /* SPARC64 relocations */2192 /* SPARC64 relocations */ 1928 2193 #define BFD_RELOC_SPARC_64 BFD_RELOC_64 1929 2194 BFD_RELOC_SPARC_10, … … 1942 2207 BFD_RELOC_SPARC_5, 1943 2208 #define BFD_RELOC_SPARC_DISP64 BFD_RELOC_64_PCREL 2209 BFD_RELOC_SPARC_PLT32, 1944 2210 BFD_RELOC_SPARC_PLT64, 1945 2211 BFD_RELOC_SPARC_HIX22, … … 1950 2216 BFD_RELOC_SPARC_REGISTER, 1951 2217 1952 /* SPARC little endian relocation */2218 /* SPARC little endian relocation */ 1953 2219 BFD_RELOC_SPARC_REV32, 2220 2221 /* SPARC TLS relocations */ 2222 BFD_RELOC_SPARC_TLS_GD_HI22, 2223 BFD_RELOC_SPARC_TLS_GD_LO10, 2224 BFD_RELOC_SPARC_TLS_GD_ADD, 2225 BFD_RELOC_SPARC_TLS_GD_CALL, 2226 BFD_RELOC_SPARC_TLS_LDM_HI22, 2227 BFD_RELOC_SPARC_TLS_LDM_LO10, 2228 BFD_RELOC_SPARC_TLS_LDM_ADD, 2229 BFD_RELOC_SPARC_TLS_LDM_CALL, 2230 BFD_RELOC_SPARC_TLS_LDO_HIX22, 2231 BFD_RELOC_SPARC_TLS_LDO_LOX10, 2232 BFD_RELOC_SPARC_TLS_LDO_ADD, 2233 BFD_RELOC_SPARC_TLS_IE_HI22, 2234 BFD_RELOC_SPARC_TLS_IE_LO10, 2235 BFD_RELOC_SPARC_TLS_IE_LD, 2236 BFD_RELOC_SPARC_TLS_IE_LDX, 2237 BFD_RELOC_SPARC_TLS_IE_ADD, 2238 BFD_RELOC_SPARC_TLS_LE_HIX22, 2239 BFD_RELOC_SPARC_TLS_LE_LOX10, 2240 BFD_RELOC_SPARC_TLS_DTPMOD32, 2241 BFD_RELOC_SPARC_TLS_DTPMOD64, 2242 BFD_RELOC_SPARC_TLS_DTPOFF32, 2243 BFD_RELOC_SPARC_TLS_DTPOFF64, 2244 BFD_RELOC_SPARC_TLS_TPOFF32, 2245 BFD_RELOC_SPARC_TLS_TPOFF64, 1954 2246 1955 2247 /* Alpha ECOFF and ELF relocations. Some of these treat the symbol or … … 1958 2250 writing; when reading, it will be the absolute section symbol. The 1959 2251 addend is the displacement in bytes of the "lda" instruction from 1960 the "ldah" instruction (which is at the address of this reloc). */2252 the "ldah" instruction (which is at the address of this reloc). */ 1961 2253 BFD_RELOC_ALPHA_GPDISP_HI16, 1962 2254 … … 1964 2256 with GPDISP_HI16 relocs. The addend is ignored when writing the 1965 2257 relocations out, and is filled in with the file's GP value on 1966 reading, for convenience. */2258 reading, for convenience. */ 1967 2259 BFD_RELOC_ALPHA_GPDISP_LO16, 1968 2260 1969 2261 /* The ELF GPDISP relocation is exactly the same as the GPDISP_HI16 1970 2262 relocation except that there is no accompanying GPDISP_LO16 1971 relocation. */2263 relocation. */ 1972 2264 BFD_RELOC_ALPHA_GPDISP, 1973 2265 … … 1994 2286 1 - "memory" fmt insn 1995 2287 2 - byte-manipulation (byte offset reg) 1996 3 - jsr (target of branch) 1997 1998 The GNU linker currently doesn't do any of this optimizing. */ 2288 3 - jsr (target of branch) */ 1999 2289 BFD_RELOC_ALPHA_LITERAL, 2000 2290 BFD_RELOC_ALPHA_ELF_LITERAL, 2001 2291 BFD_RELOC_ALPHA_LITUSE, 2002 2292 2003 /* The BFD_RELOC_ALPHA_USER_* relocations are used by the assembler to2004 process the explicit !<reloc>!sequence relocations, and are mapped2005 into the normal relocations at the end of processing. */2006 BFD_RELOC_ALPHA_USER_LITERAL,2007 BFD_RELOC_ALPHA_USER_LITUSE_BASE,2008 BFD_RELOC_ALPHA_USER_LITUSE_BYTOFF,2009 BFD_RELOC_ALPHA_USER_LITUSE_JSR,2010 BFD_RELOC_ALPHA_USER_GPDISP,2011 BFD_RELOC_ALPHA_USER_GPRELHIGH,2012 BFD_RELOC_ALPHA_USER_GPRELLOW,2013 2014 2293 /* The HINT relocation indicates a value that should be filled into the 2015 2294 "hint" field of a jmp/jsr/ret instruction, for possible branch- 2016 prediction logic which may be provided on some processors. */2295 prediction logic which may be provided on some processors. */ 2017 2296 BFD_RELOC_ALPHA_HINT, 2018 2297 2019 2298 /* The LINKAGE relocation outputs a linkage pair in the object file, 2020 which is filled by the linker. */2299 which is filled by the linker. */ 2021 2300 BFD_RELOC_ALPHA_LINKAGE, 2022 2301 2023 2302 /* The CODEADDR relocation outputs a STO_CA in the object file, 2024 which is filled by the linker. */2303 which is filled by the linker. */ 2025 2304 BFD_RELOC_ALPHA_CODEADDR, 2026 2305 2306 /* The GPREL_HI/LO relocations together form a 32-bit offset from the 2307 GP register. */ 2308 BFD_RELOC_ALPHA_GPREL_HI16, 2309 BFD_RELOC_ALPHA_GPREL_LO16, 2310 2311 /* Like BFD_RELOC_23_PCREL_S2, except that the source and target must 2312 share a common GP, and the target address is adjusted for 2313 STO_ALPHA_STD_GPLOAD. */ 2314 BFD_RELOC_ALPHA_BRSGP, 2315 2316 /* Alpha thread-local storage relocations. */ 2317 BFD_RELOC_ALPHA_TLSGD, 2318 BFD_RELOC_ALPHA_TLSLDM, 2319 BFD_RELOC_ALPHA_DTPMOD64, 2320 BFD_RELOC_ALPHA_GOTDTPREL16, 2321 BFD_RELOC_ALPHA_DTPREL64, 2322 BFD_RELOC_ALPHA_DTPREL_HI16, 2323 BFD_RELOC_ALPHA_DTPREL_LO16, 2324 BFD_RELOC_ALPHA_DTPREL16, 2325 BFD_RELOC_ALPHA_GOTTPREL16, 2326 BFD_RELOC_ALPHA_TPREL64, 2327 BFD_RELOC_ALPHA_TPREL_HI16, 2328 BFD_RELOC_ALPHA_TPREL_LO16, 2329 BFD_RELOC_ALPHA_TPREL16, 2330 2027 2331 /* Bits 27..2 of the relocation address shifted right 2 bits; 2028 simple reloc otherwise. */2332 simple reloc otherwise. */ 2029 2333 BFD_RELOC_MIPS_JMP, 2030 2334 2031 /* The MIPS16 jump instruction. */2335 /* The MIPS16 jump instruction. */ 2032 2336 BFD_RELOC_MIPS16_JMP, 2033 2337 2034 /* MIPS16 GP relative reloc. */2338 /* MIPS16 GP relative reloc. */ 2035 2339 BFD_RELOC_MIPS16_GPREL, 2036 2340 2037 /* High 16 bits of 32-bit value; simple reloc. */2341 /* High 16 bits of 32-bit value; simple reloc. */ 2038 2342 BFD_RELOC_HI16, 2039 2343 … … 2041 2345 extended and added to form the final result. If the low 16 2042 2346 bits form a negative number, we need to add one to the high value 2043 to compensate for the borrow when the low bits are added. */2347 to compensate for the borrow when the low bits are added. */ 2044 2348 BFD_RELOC_HI16_S, 2045 2349 2046 /* Low 16 bits. */2350 /* Low 16 bits. */ 2047 2351 BFD_RELOC_LO16, 2048 2352 2049 /* Like BFD_RELOC_HI16_S, but PC relative. */2353 /* Like BFD_RELOC_HI16_S, but PC relative. */ 2050 2354 BFD_RELOC_PCREL_HI16_S, 2051 2355 2052 /* Like BFD_RELOC_LO16, but PC relative. */2356 /* Like BFD_RELOC_LO16, but PC relative. */ 2053 2357 BFD_RELOC_PCREL_LO16, 2054 2358 2055 /* Relocation relative to the global pointer. */ 2056 #define BFD_RELOC_MIPS_GPREL BFD_RELOC_GPREL16 2057 2058 /* Relocation against a MIPS literal section. */ 2359 /* Relocation against a MIPS literal section. */ 2059 2360 BFD_RELOC_MIPS_LITERAL, 2060 2361 2061 /* MIPS ELF relocations. */2362 /* MIPS ELF relocations. */ 2062 2363 BFD_RELOC_MIPS_GOT16, 2063 2364 BFD_RELOC_MIPS_CALL16, 2064 #define BFD_RELOC_MIPS_GPREL32 BFD_RELOC_GPREL322065 2365 BFD_RELOC_MIPS_GOT_HI16, 2066 2366 BFD_RELOC_MIPS_GOT_LO16, … … 2083 2383 BFD_RELOC_MIPS_JALR, 2084 2384 2085 2086 /* i386/elf relocations */ 2385 /* Fujitsu Frv Relocations. */ 2386 BFD_RELOC_FRV_LABEL16, 2387 BFD_RELOC_FRV_LABEL24, 2388 BFD_RELOC_FRV_LO16, 2389 BFD_RELOC_FRV_HI16, 2390 BFD_RELOC_FRV_GPREL12, 2391 BFD_RELOC_FRV_GPRELU12, 2392 BFD_RELOC_FRV_GPREL32, 2393 BFD_RELOC_FRV_GPRELHI, 2394 BFD_RELOC_FRV_GPRELLO, 2395 2396 2397 /* i386/elf relocations */ 2087 2398 BFD_RELOC_386_GOT32, 2088 2399 BFD_RELOC_386_PLT32, … … 2093 2404 BFD_RELOC_386_GOTOFF, 2094 2405 BFD_RELOC_386_GOTPC, 2095 2096 /* x86-64/elf relocations */ 2406 BFD_RELOC_386_TLS_TPOFF, 2407 BFD_RELOC_386_TLS_IE, 2408 BFD_RELOC_386_TLS_GOTIE, 2409 BFD_RELOC_386_TLS_LE, 2410 BFD_RELOC_386_TLS_GD, 2411 BFD_RELOC_386_TLS_LDM, 2412 BFD_RELOC_386_TLS_LDO_32, 2413 BFD_RELOC_386_TLS_IE_32, 2414 BFD_RELOC_386_TLS_LE_32, 2415 BFD_RELOC_386_TLS_DTPMOD32, 2416 BFD_RELOC_386_TLS_DTPOFF32, 2417 BFD_RELOC_386_TLS_TPOFF32, 2418 2419 /* x86-64/elf relocations */ 2097 2420 BFD_RELOC_X86_64_GOT32, 2098 2421 BFD_RELOC_X86_64_PLT32, … … 2103 2426 BFD_RELOC_X86_64_GOTPCREL, 2104 2427 BFD_RELOC_X86_64_32S, 2105 2106 /* ns32k relocations */ 2428 BFD_RELOC_X86_64_DTPMOD64, 2429 BFD_RELOC_X86_64_DTPOFF64, 2430 BFD_RELOC_X86_64_TPOFF64, 2431 BFD_RELOC_X86_64_TLSGD, 2432 BFD_RELOC_X86_64_TLSLD, 2433 BFD_RELOC_X86_64_DTPOFF32, 2434 BFD_RELOC_X86_64_GOTTPOFF, 2435 BFD_RELOC_X86_64_TPOFF32, 2436 2437 /* ns32k relocations */ 2107 2438 BFD_RELOC_NS32K_IMM_8, 2108 2439 BFD_RELOC_NS32K_IMM_16, … … 2118 2449 BFD_RELOC_NS32K_DISP_32_PCREL, 2119 2450 2120 /* Picojava relocs. Not all of these appear in object files. */ 2451 /* PDP11 relocations */ 2452 BFD_RELOC_PDP11_DISP_8_PCREL, 2453 BFD_RELOC_PDP11_DISP_6_PCREL, 2454 2455 /* Picojava relocs. Not all of these appear in object files. */ 2121 2456 BFD_RELOC_PJ_CODE_HI16, 2122 2457 BFD_RELOC_PJ_CODE_LO16, … … 2126 2461 BFD_RELOC_PJ_CODE_REL32, 2127 2462 2128 /* Power(rs6000) and PowerPC relocations. */2463 /* Power(rs6000) and PowerPC relocations. */ 2129 2464 BFD_RELOC_PPC_B26, 2130 2465 BFD_RELOC_PPC_BA26, … … 2157 2492 BFD_RELOC_PPC_EMB_BIT_FLD, 2158 2493 BFD_RELOC_PPC_EMB_RELSDA, 2159 2160 /* IBM 370/390 relocations */ 2494 BFD_RELOC_PPC64_HIGHER, 2495 BFD_RELOC_PPC64_HIGHER_S, 2496 BFD_RELOC_PPC64_HIGHEST, 2497 BFD_RELOC_PPC64_HIGHEST_S, 2498 BFD_RELOC_PPC64_TOC16_LO, 2499 BFD_RELOC_PPC64_TOC16_HI, 2500 BFD_RELOC_PPC64_TOC16_HA, 2501 BFD_RELOC_PPC64_TOC, 2502 BFD_RELOC_PPC64_PLTGOT16, 2503 BFD_RELOC_PPC64_PLTGOT16_LO, 2504 BFD_RELOC_PPC64_PLTGOT16_HI, 2505 BFD_RELOC_PPC64_PLTGOT16_HA, 2506 BFD_RELOC_PPC64_ADDR16_DS, 2507 BFD_RELOC_PPC64_ADDR16_LO_DS, 2508 BFD_RELOC_PPC64_GOT16_DS, 2509 BFD_RELOC_PPC64_GOT16_LO_DS, 2510 BFD_RELOC_PPC64_PLT16_LO_DS, 2511 BFD_RELOC_PPC64_SECTOFF_DS, 2512 BFD_RELOC_PPC64_SECTOFF_LO_DS, 2513 BFD_RELOC_PPC64_TOC16_DS, 2514 BFD_RELOC_PPC64_TOC16_LO_DS, 2515 BFD_RELOC_PPC64_PLTGOT16_DS, 2516 BFD_RELOC_PPC64_PLTGOT16_LO_DS, 2517 2518 /* PowerPC and PowerPC64 thread-local storage relocations. */ 2519 BFD_RELOC_PPC_TLS, 2520 BFD_RELOC_PPC_DTPMOD, 2521 BFD_RELOC_PPC_TPREL16, 2522 BFD_RELOC_PPC_TPREL16_LO, 2523 BFD_RELOC_PPC_TPREL16_HI, 2524 BFD_RELOC_PPC_TPREL16_HA, 2525 BFD_RELOC_PPC_TPREL, 2526 BFD_RELOC_PPC_DTPREL16, 2527 BFD_RELOC_PPC_DTPREL16_LO, 2528 BFD_RELOC_PPC_DTPREL16_HI, 2529 BFD_RELOC_PPC_DTPREL16_HA, 2530 BFD_RELOC_PPC_DTPREL, 2531 BFD_RELOC_PPC_GOT_TLSGD16, 2532 BFD_RELOC_PPC_GOT_TLSGD16_LO, 2533 BFD_RELOC_PPC_GOT_TLSGD16_HI, 2534 BFD_RELOC_PPC_GOT_TLSGD16_HA, 2535 BFD_RELOC_PPC_GOT_TLSLD16, 2536 BFD_RELOC_PPC_GOT_TLSLD16_LO, 2537 BFD_RELOC_PPC_GOT_TLSLD16_HI, 2538 BFD_RELOC_PPC_GOT_TLSLD16_HA, 2539 BFD_RELOC_PPC_GOT_TPREL16, 2540 BFD_RELOC_PPC_GOT_TPREL16_LO, 2541 BFD_RELOC_PPC_GOT_TPREL16_HI, 2542 BFD_RELOC_PPC_GOT_TPREL16_HA, 2543 BFD_RELOC_PPC_GOT_DTPREL16, 2544 BFD_RELOC_PPC_GOT_DTPREL16_LO, 2545 BFD_RELOC_PPC_GOT_DTPREL16_HI, 2546 BFD_RELOC_PPC_GOT_DTPREL16_HA, 2547 BFD_RELOC_PPC64_TPREL16_DS, 2548 BFD_RELOC_PPC64_TPREL16_LO_DS, 2549 BFD_RELOC_PPC64_TPREL16_HIGHER, 2550 BFD_RELOC_PPC64_TPREL16_HIGHERA, 2551 BFD_RELOC_PPC64_TPREL16_HIGHEST, 2552 BFD_RELOC_PPC64_TPREL16_HIGHESTA, 2553 BFD_RELOC_PPC64_DTPREL16_DS, 2554 BFD_RELOC_PPC64_DTPREL16_LO_DS, 2555 BFD_RELOC_PPC64_DTPREL16_HIGHER, 2556 BFD_RELOC_PPC64_DTPREL16_HIGHERA, 2557 BFD_RELOC_PPC64_DTPREL16_HIGHEST, 2558 BFD_RELOC_PPC64_DTPREL16_HIGHESTA, 2559 2560 /* IBM 370/390 relocations */ 2161 2561 BFD_RELOC_I370_D12, 2162 2562 2163 2563 /* The type of reloc used to build a contructor table - at the moment 2164 2564 probably a 32 bit wide absolute relocation, but the target can choose. 2165 It generally does map to one of the other relocation types. */2565 It generally does map to one of the other relocation types. */ 2166 2566 BFD_RELOC_CTOR, 2167 2567 2168 2568 /* ARM 26 bit pc-relative branch. The lowest two bits must be zero and are 2169 not stored in the instruction. */2569 not stored in the instruction. */ 2170 2570 BFD_RELOC_ARM_PCREL_BRANCH, 2171 2571 2172 2572 /* ARM 26 bit pc-relative branch. The lowest bit must be zero and is 2173 2573 not stored in the instruction. The 2nd lowest bit comes from a 1 bit 2174 field in the instruction. */2574 field in the instruction. */ 2175 2575 BFD_RELOC_ARM_PCREL_BLX, 2176 2576 2177 2577 /* Thumb 22 bit pc-relative branch. The lowest bit must be zero and is 2178 2578 not stored in the instruction. The 2nd lowest bit comes from a 1 bit 2179 field in the instruction. */2579 field in the instruction. */ 2180 2580 BFD_RELOC_THUMB_PCREL_BLX, 2181 2581 2182 2582 /* These relocs are only used within the ARM assembler. They are not 2183 (at present) written to any object files. */2583 (at present) written to any object files. */ 2184 2584 BFD_RELOC_ARM_IMMEDIATE, 2185 2585 BFD_RELOC_ARM_ADRL_IMMEDIATE, … … 2189 2589 BFD_RELOC_ARM_MULTI, 2190 2590 BFD_RELOC_ARM_CP_OFF_IMM, 2591 BFD_RELOC_ARM_CP_OFF_IMM_S2, 2191 2592 BFD_RELOC_ARM_ADR_IMM, 2192 2593 BFD_RELOC_ARM_LDR_IMM, … … 2209 2610 BFD_RELOC_ARM_GOTPC, 2210 2611 2211 /* Hitachi SH relocs. Not all of these appear in object files.*/2612 /* Renesas / SuperH SH relocs. Not all of these appear in object files. */ 2212 2613 BFD_RELOC_SH_PCDISP8BY2, 2213 2614 BFD_RELOC_SH_PCDISP12BY2, … … 2235 2636 BFD_RELOC_SH_RELATIVE, 2236 2637 BFD_RELOC_SH_GOTPC, 2638 BFD_RELOC_SH_GOT_LOW16, 2639 BFD_RELOC_SH_GOT_MEDLOW16, 2640 BFD_RELOC_SH_GOT_MEDHI16, 2641 BFD_RELOC_SH_GOT_HI16, 2642 BFD_RELOC_SH_GOTPLT_LOW16, 2643 BFD_RELOC_SH_GOTPLT_MEDLOW16, 2644 BFD_RELOC_SH_GOTPLT_MEDHI16, 2645 BFD_RELOC_SH_GOTPLT_HI16, 2646 BFD_RELOC_SH_PLT_LOW16, 2647 BFD_RELOC_SH_PLT_MEDLOW16, 2648 BFD_RELOC_SH_PLT_MEDHI16, 2649 BFD_RELOC_SH_PLT_HI16, 2650 BFD_RELOC_SH_GOTOFF_LOW16, 2651 BFD_RELOC_SH_GOTOFF_MEDLOW16, 2652 BFD_RELOC_SH_GOTOFF_MEDHI16, 2653 BFD_RELOC_SH_GOTOFF_HI16, 2654 BFD_RELOC_SH_GOTPC_LOW16, 2655 BFD_RELOC_SH_GOTPC_MEDLOW16, 2656 BFD_RELOC_SH_GOTPC_MEDHI16, 2657 BFD_RELOC_SH_GOTPC_HI16, 2658 BFD_RELOC_SH_COPY64, 2659 BFD_RELOC_SH_GLOB_DAT64, 2660 BFD_RELOC_SH_JMP_SLOT64, 2661 BFD_RELOC_SH_RELATIVE64, 2662 BFD_RELOC_SH_GOT10BY4, 2663 BFD_RELOC_SH_GOT10BY8, 2664 BFD_RELOC_SH_GOTPLT10BY4, 2665 BFD_RELOC_SH_GOTPLT10BY8, 2666 BFD_RELOC_SH_GOTPLT32, 2667 BFD_RELOC_SH_SHMEDIA_CODE, 2668 BFD_RELOC_SH_IMMU5, 2669 BFD_RELOC_SH_IMMS6, 2670 BFD_RELOC_SH_IMMS6BY32, 2671 BFD_RELOC_SH_IMMU6, 2672 BFD_RELOC_SH_IMMS10, 2673 BFD_RELOC_SH_IMMS10BY2, 2674 BFD_RELOC_SH_IMMS10BY4, 2675 BFD_RELOC_SH_IMMS10BY8, 2676 BFD_RELOC_SH_IMMS16, 2677 BFD_RELOC_SH_IMMU16, 2678 BFD_RELOC_SH_IMM_LOW16, 2679 BFD_RELOC_SH_IMM_LOW16_PCREL, 2680 BFD_RELOC_SH_IMM_MEDLOW16, 2681 BFD_RELOC_SH_IMM_MEDLOW16_PCREL, 2682 BFD_RELOC_SH_IMM_MEDHI16, 2683 BFD_RELOC_SH_IMM_MEDHI16_PCREL, 2684 BFD_RELOC_SH_IMM_HI16, 2685 BFD_RELOC_SH_IMM_HI16_PCREL, 2686 BFD_RELOC_SH_PT_16, 2687 BFD_RELOC_SH_TLS_GD_32, 2688 BFD_RELOC_SH_TLS_LD_32, 2689 BFD_RELOC_SH_TLS_LDO_32, 2690 BFD_RELOC_SH_TLS_IE_32, 2691 BFD_RELOC_SH_TLS_LE_32, 2692 BFD_RELOC_SH_TLS_DTPMOD32, 2693 BFD_RELOC_SH_TLS_DTPOFF32, 2694 BFD_RELOC_SH_TLS_TPOFF32, 2237 2695 2238 2696 /* Thumb 23-, 12- and 9-bit pc-relative branches. The lowest bit must 2239 be zero and is not stored in the instruction. */2697 be zero and is not stored in the instruction. */ 2240 2698 BFD_RELOC_THUMB_PCREL_BRANCH9, 2241 2699 BFD_RELOC_THUMB_PCREL_BRANCH12, … … 2245 2703 ARC 22 bit pc-relative branch. The lowest two bits must be zero and are 2246 2704 not stored in the instruction. The high 20 bits are installed in bits 26 2247 through 7 of the instruction. */2705 through 7 of the instruction. */ 2248 2706 BFD_RELOC_ARC_B22_PCREL, 2249 2707 2250 2708 /* ARC 26 bit absolute branch. The lowest two bits must be zero and are not 2251 2709 stored in the instruction. The high 24 bits are installed in bits 23 2252 through 0. */2710 through 0. */ 2253 2711 BFD_RELOC_ARC_B26, 2254 2712 2255 2713 /* Mitsubishi D10V relocs. 2256 2714 This is a 10-bit reloc with the right 2 bits 2257 assumed to be 0. */2715 assumed to be 0. */ 2258 2716 BFD_RELOC_D10V_10_PCREL_R, 2259 2717 … … 2262 2720 assumed to be 0. This is the same as the previous reloc 2263 2721 except it is in the left container, i.e., 2264 shifted left 15 bits. */2722 shifted left 15 bits. */ 2265 2723 BFD_RELOC_D10V_10_PCREL_L, 2266 2724 2267 2725 /* This is an 18-bit reloc with the right 2 bits 2268 assumed to be 0. */2726 assumed to be 0. */ 2269 2727 BFD_RELOC_D10V_18, 2270 2728 2271 2729 /* This is an 18-bit reloc with the right 2 bits 2272 assumed to be 0. */2730 assumed to be 0. */ 2273 2731 BFD_RELOC_D10V_18_PCREL, 2274 2732 2275 2733 /* Mitsubishi D30V relocs. 2276 This is a 6-bit absolute reloc. */2734 This is a 6-bit absolute reloc. */ 2277 2735 BFD_RELOC_D30V_6, 2278 2736 2279 2737 /* This is a 6-bit pc-relative reloc with 2280 the right 3 bits assumed to be 0. */2738 the right 3 bits assumed to be 0. */ 2281 2739 BFD_RELOC_D30V_9_PCREL, 2282 2740 … … 2284 2742 the right 3 bits assumed to be 0. Same 2285 2743 as the previous reloc but on the right side 2286 of the container. */2744 of the container. */ 2287 2745 BFD_RELOC_D30V_9_PCREL_R, 2288 2746 2289 2747 /* This is a 12-bit absolute reloc with the 2290 right 3 bitsassumed to be 0. */2748 right 3 bitsassumed to be 0. */ 2291 2749 BFD_RELOC_D30V_15, 2292 2750 2293 2751 /* This is a 12-bit pc-relative reloc with 2294 the right 3 bits assumed to be 0. */2752 the right 3 bits assumed to be 0. */ 2295 2753 BFD_RELOC_D30V_15_PCREL, 2296 2754 … … 2298 2756 the right 3 bits assumed to be 0. Same 2299 2757 as the previous reloc but on the right side 2300 of the container. */2758 of the container. */ 2301 2759 BFD_RELOC_D30V_15_PCREL_R, 2302 2760 2303 2761 /* This is an 18-bit absolute reloc with 2304 the right 3 bits assumed to be 0. */2762 the right 3 bits assumed to be 0. */ 2305 2763 BFD_RELOC_D30V_21, 2306 2764 2307 2765 /* This is an 18-bit pc-relative reloc with 2308 the right 3 bits assumed to be 0. */2766 the right 3 bits assumed to be 0. */ 2309 2767 BFD_RELOC_D30V_21_PCREL, 2310 2768 … … 2312 2770 the right 3 bits assumed to be 0. Same 2313 2771 as the previous reloc but on the right side 2314 of the container. */2772 of the container. */ 2315 2773 BFD_RELOC_D30V_21_PCREL_R, 2316 2774 2317 /* This is a 32-bit absolute reloc. */2775 /* This is a 32-bit absolute reloc. */ 2318 2776 BFD_RELOC_D30V_32, 2319 2777 2320 /* This is a 32-bit pc-relative reloc. */2778 /* This is a 32-bit pc-relative reloc. */ 2321 2779 BFD_RELOC_D30V_32_PCREL, 2322 2780 2323 /* Mitsubishi M32R relocs. 2324 This is a 24 bit absolute address. */ 2781 /* DLX relocs */ 2782 BFD_RELOC_DLX_HI16_S, 2783 2784 /* DLX relocs */ 2785 BFD_RELOC_DLX_LO16, 2786 2787 /* DLX relocs */ 2788 BFD_RELOC_DLX_JMP26, 2789 2790 /* Renesas M32R (formerly Mitsubishi M32R) relocs. 2791 This is a 24 bit absolute address. */ 2325 2792 BFD_RELOC_M32R_24, 2326 2793 2327 /* This is a 10-bit pc-relative reloc with the right 2 bits assumed to be 0. */2794 /* This is a 10-bit pc-relative reloc with the right 2 bits assumed to be 0. */ 2328 2795 BFD_RELOC_M32R_10_PCREL, 2329 2796 2330 /* This is an 18-bit reloc with the right 2 bits assumed to be 0. */2797 /* This is an 18-bit reloc with the right 2 bits assumed to be 0. */ 2331 2798 BFD_RELOC_M32R_18_PCREL, 2332 2799 2333 /* This is a 26-bit reloc with the right 2 bits assumed to be 0. */2800 /* This is a 26-bit reloc with the right 2 bits assumed to be 0. */ 2334 2801 BFD_RELOC_M32R_26_PCREL, 2335 2802 2336 2803 /* This is a 16-bit reloc containing the high 16 bits of an address 2337 used when the lower 16 bits are treated as unsigned. */2804 used when the lower 16 bits are treated as unsigned. */ 2338 2805 BFD_RELOC_M32R_HI16_ULO, 2339 2806 2340 2807 /* This is a 16-bit reloc containing the high 16 bits of an address 2341 used when the lower 16 bits are treated as signed. */2808 used when the lower 16 bits are treated as signed. */ 2342 2809 BFD_RELOC_M32R_HI16_SLO, 2343 2810 2344 /* This is a 16-bit reloc containing the lower 16 bits of an address. */2811 /* This is a 16-bit reloc containing the lower 16 bits of an address. */ 2345 2812 BFD_RELOC_M32R_LO16, 2346 2813 2347 2814 /* This is a 16-bit reloc containing the small data area offset for use in 2348 add3, load, and store instructions. */2815 add3, load, and store instructions. */ 2349 2816 BFD_RELOC_M32R_SDA16, 2350 2817 2351 /* This is a 9-bit reloc */2818 /* This is a 9-bit reloc */ 2352 2819 BFD_RELOC_V850_9_PCREL, 2353 2820 2354 /* This is a 22-bit reloc */2821 /* This is a 22-bit reloc */ 2355 2822 BFD_RELOC_V850_22_PCREL, 2356 2823 2357 /* This is a 16 bit offset from the short data area pointer. */2824 /* This is a 16 bit offset from the short data area pointer. */ 2358 2825 BFD_RELOC_V850_SDA_16_16_OFFSET, 2359 2826 2360 2827 /* This is a 16 bit offset (of which only 15 bits are used) from the 2361 short data area pointer. */2828 short data area pointer. */ 2362 2829 BFD_RELOC_V850_SDA_15_16_OFFSET, 2363 2830 2364 /* This is a 16 bit offset from the zero data area pointer. */2831 /* This is a 16 bit offset from the zero data area pointer. */ 2365 2832 BFD_RELOC_V850_ZDA_16_16_OFFSET, 2366 2833 2367 2834 /* This is a 16 bit offset (of which only 15 bits are used) from the 2368 zero data area pointer. */2835 zero data area pointer. */ 2369 2836 BFD_RELOC_V850_ZDA_15_16_OFFSET, 2370 2837 2371 2838 /* This is an 8 bit offset (of which only 6 bits are used) from the 2372 tiny data area pointer. */2839 tiny data area pointer. */ 2373 2840 BFD_RELOC_V850_TDA_6_8_OFFSET, 2374 2841 2375 2842 /* This is an 8bit offset (of which only 7 bits are used) from the tiny 2376 data area pointer. */2843 data area pointer. */ 2377 2844 BFD_RELOC_V850_TDA_7_8_OFFSET, 2378 2845 2379 /* This is a 7 bit offset from the tiny data area pointer. */2846 /* This is a 7 bit offset from the tiny data area pointer. */ 2380 2847 BFD_RELOC_V850_TDA_7_7_OFFSET, 2381 2848 2382 /* This is a 16 bit offset from the tiny data area pointer. */2849 /* This is a 16 bit offset from the tiny data area pointer. */ 2383 2850 BFD_RELOC_V850_TDA_16_16_OFFSET, 2384 2851 2385 2852 /* This is a 5 bit offset (of which only 4 bits are used) from the tiny 2386 data area pointer. */2853 data area pointer. */ 2387 2854 BFD_RELOC_V850_TDA_4_5_OFFSET, 2388 2855 2389 /* This is a 4 bit offset from the tiny data area pointer. */2856 /* This is a 4 bit offset from the tiny data area pointer. */ 2390 2857 BFD_RELOC_V850_TDA_4_4_OFFSET, 2391 2858 2392 2859 /* This is a 16 bit offset from the short data area pointer, with the 2393 bits placed non-contigously in the instruction. */2860 bits placed non-contigously in the instruction. */ 2394 2861 BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET, 2395 2862 2396 2863 /* This is a 16 bit offset from the zero data area pointer, with the 2397 bits placed non-contigously in the instruction. */2864 bits placed non-contigously in the instruction. */ 2398 2865 BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET, 2399 2866 2400 /* This is a 6 bit offset from the call table base pointer. */2867 /* This is a 6 bit offset from the call table base pointer. */ 2401 2868 BFD_RELOC_V850_CALLT_6_7_OFFSET, 2402 2869 2403 /* This is a 16 bit offset from the call table base pointer. */2870 /* This is a 16 bit offset from the call table base pointer. */ 2404 2871 BFD_RELOC_V850_CALLT_16_16_OFFSET, 2405 2872 2873 /* Used for relaxing indirect function calls. */ 2874 BFD_RELOC_V850_LONGCALL, 2875 2876 /* Used for relaxing indirect jumps. */ 2877 BFD_RELOC_V850_LONGJUMP, 2878 2879 /* Used to maintain alignment whilst relaxing. */ 2880 BFD_RELOC_V850_ALIGN, 2406 2881 2407 2882 /* This is a 32bit pcrel reloc for the mn10300, offset by two bytes in the 2408 instruction. */2883 instruction. */ 2409 2884 BFD_RELOC_MN10300_32_PCREL, 2410 2885 2411 2886 /* This is a 16bit pcrel reloc for the mn10300, offset by two bytes in the 2412 instruction. */2887 instruction. */ 2413 2888 BFD_RELOC_MN10300_16_PCREL, 2414 2889 2415 2890 /* This is a 8bit DP reloc for the tms320c30, where the most 2416 2891 significant 8 bits of a 24 bit word are placed into the least 2417 significant 8 bits of the opcode. */2892 significant 8 bits of the opcode. */ 2418 2893 BFD_RELOC_TIC30_LDP, 2419 2894 2420 2895 /* This is a 7bit reloc for the tms320c54x, where the least 2421 2896 significant 7 bits of a 16 bit word are placed into the least 2422 significant 7 bits of the opcode. */2897 significant 7 bits of the opcode. */ 2423 2898 BFD_RELOC_TIC54X_PARTLS7, 2424 2899 2425 2900 /* This is a 9bit DP reloc for the tms320c54x, where the most 2426 2901 significant 9 bits of a 16 bit word are placed into the least 2427 significant 9 bits of the opcode. */2902 significant 9 bits of the opcode. */ 2428 2903 BFD_RELOC_TIC54X_PARTMS9, 2429 2904 2430 /* This is an extended address 23-bit reloc for the tms320c54x. */2905 /* This is an extended address 23-bit reloc for the tms320c54x. */ 2431 2906 BFD_RELOC_TIC54X_23, 2432 2907 2433 2908 /* This is a 16-bit reloc for the tms320c54x, where the least 2434 2909 significant 16 bits of a 23-bit extended address are placed into 2435 the opcode. */2910 the opcode. */ 2436 2911 BFD_RELOC_TIC54X_16_OF_23, 2437 2912 2438 2913 /* This is a reloc for the tms320c54x, where the most 2439 2914 significant 7 bits of a 23-bit extended address are placed into 2440 the opcode. */2915 the opcode. */ 2441 2916 BFD_RELOC_TIC54X_MS7_OF_23, 2442 2917 2443 /* This is a 48 bit reloc for the FR30 that stores 32 bits. */2918 /* This is a 48 bit reloc for the FR30 that stores 32 bits. */ 2444 2919 BFD_RELOC_FR30_48, 2445 2920 2446 2921 /* This is a 32 bit reloc for the FR30 that stores 20 bits split up into 2447 two sections. */2922 two sections. */ 2448 2923 BFD_RELOC_FR30_20, 2449 2924 2450 2925 /* This is a 16 bit reloc for the FR30 that stores a 6 bit word offset in 2451 4 bits. */2926 4 bits. */ 2452 2927 BFD_RELOC_FR30_6_IN_4, 2453 2928 2454 2929 /* This is a 16 bit reloc for the FR30 that stores an 8 bit byte offset 2455 into 8 bits. */2930 into 8 bits. */ 2456 2931 BFD_RELOC_FR30_8_IN_8, 2457 2932 2458 2933 /* This is a 16 bit reloc for the FR30 that stores a 9 bit short offset 2459 into 8 bits. */2934 into 8 bits. */ 2460 2935 BFD_RELOC_FR30_9_IN_8, 2461 2936 2462 2937 /* This is a 16 bit reloc for the FR30 that stores a 10 bit word offset 2463 into 8 bits. */2938 into 8 bits. */ 2464 2939 BFD_RELOC_FR30_10_IN_8, 2465 2940 2466 2941 /* This is a 16 bit reloc for the FR30 that stores a 9 bit pc relative 2467 short offset into 8 bits. */2942 short offset into 8 bits. */ 2468 2943 BFD_RELOC_FR30_9_PCREL, 2469 2944 2470 2945 /* This is a 16 bit reloc for the FR30 that stores a 12 bit pc relative 2471 short offset into 11 bits. */2946 short offset into 11 bits. */ 2472 2947 BFD_RELOC_FR30_12_PCREL, 2473 2948 2474 /* Motorola Mcore relocations. */2949 /* Motorola Mcore relocations. */ 2475 2950 BFD_RELOC_MCORE_PCREL_IMM8BY4, 2476 2951 BFD_RELOC_MCORE_PCREL_IMM11BY2, … … 2480 2955 BFD_RELOC_MCORE_RVA, 2481 2956 2957 /* These are relocations for the GETA instruction. */ 2958 BFD_RELOC_MMIX_GETA, 2959 BFD_RELOC_MMIX_GETA_1, 2960 BFD_RELOC_MMIX_GETA_2, 2961 BFD_RELOC_MMIX_GETA_3, 2962 2963 /* These are relocations for a conditional branch instruction. */ 2964 BFD_RELOC_MMIX_CBRANCH, 2965 BFD_RELOC_MMIX_CBRANCH_J, 2966 BFD_RELOC_MMIX_CBRANCH_1, 2967 BFD_RELOC_MMIX_CBRANCH_2, 2968 BFD_RELOC_MMIX_CBRANCH_3, 2969 2970 /* These are relocations for the PUSHJ instruction. */ 2971 BFD_RELOC_MMIX_PUSHJ, 2972 BFD_RELOC_MMIX_PUSHJ_1, 2973 BFD_RELOC_MMIX_PUSHJ_2, 2974 BFD_RELOC_MMIX_PUSHJ_3, 2975 2976 /* These are relocations for the JMP instruction. */ 2977 BFD_RELOC_MMIX_JMP, 2978 BFD_RELOC_MMIX_JMP_1, 2979 BFD_RELOC_MMIX_JMP_2, 2980 BFD_RELOC_MMIX_JMP_3, 2981 2982 /* This is a relocation for a relative address as in a GETA instruction or 2983 a branch. */ 2984 BFD_RELOC_MMIX_ADDR19, 2985 2986 /* This is a relocation for a relative address as in a JMP instruction. */ 2987 BFD_RELOC_MMIX_ADDR27, 2988 2989 /* This is a relocation for an instruction field that may be a general 2990 register or a value 0..255. */ 2991 BFD_RELOC_MMIX_REG_OR_BYTE, 2992 2993 /* This is a relocation for an instruction field that may be a general 2994 register. */ 2995 BFD_RELOC_MMIX_REG, 2996 2997 /* This is a relocation for two instruction fields holding a register and 2998 an offset, the equivalent of the relocation. */ 2999 BFD_RELOC_MMIX_BASE_PLUS_OFFSET, 3000 3001 /* This relocation is an assertion that the expression is not allocated as 3002 a global register. It does not modify contents. */ 3003 BFD_RELOC_MMIX_LOCAL, 3004 2482 3005 /* This is a 16 bit reloc for the AVR that stores 8 bit pc relative 2483 short offset into 7 bits. */3006 short offset into 7 bits. */ 2484 3007 BFD_RELOC_AVR_7_PCREL, 2485 3008 2486 3009 /* This is a 16 bit reloc for the AVR that stores 13 bit pc relative 2487 short offset into 12 bits. */3010 short offset into 12 bits. */ 2488 3011 BFD_RELOC_AVR_13_PCREL, 2489 3012 2490 3013 /* This is a 16 bit reloc for the AVR that stores 17 bit value (usually 2491 program memory address) into 16 bits. */3014 program memory address) into 16 bits. */ 2492 3015 BFD_RELOC_AVR_16_PM, 2493 3016 2494 3017 /* This is a 16 bit reloc for the AVR that stores 8 bit value (usually 2495 data memory address) into 8 bit immediate value of LDI insn. */3018 data memory address) into 8 bit immediate value of LDI insn. */ 2496 3019 BFD_RELOC_AVR_LO8_LDI, 2497 3020 2498 3021 /* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit 2499 of data memory address) into 8 bit immediate value of LDI insn. */3022 of data memory address) into 8 bit immediate value of LDI insn. */ 2500 3023 BFD_RELOC_AVR_HI8_LDI, 2501 3024 2502 3025 /* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit 2503 of program memory address) into 8 bit immediate value of LDI insn. */3026 of program memory address) into 8 bit immediate value of LDI insn. */ 2504 3027 BFD_RELOC_AVR_HH8_LDI, 2505 3028 2506 3029 /* This is a 16 bit reloc for the AVR that stores negated 8 bit value 2507 (usually data memory address) into 8 bit immediate value of SUBI insn. */3030 (usually data memory address) into 8 bit immediate value of SUBI insn. */ 2508 3031 BFD_RELOC_AVR_LO8_LDI_NEG, 2509 3032 2510 3033 /* This is a 16 bit reloc for the AVR that stores negated 8 bit value 2511 3034 (high 8 bit of data memory address) into 8 bit immediate value of 2512 SUBI insn. */3035 SUBI insn. */ 2513 3036 BFD_RELOC_AVR_HI8_LDI_NEG, 2514 3037 2515 3038 /* This is a 16 bit reloc for the AVR that stores negated 8 bit value 2516 3039 (most high 8 bit of program memory address) into 8 bit immediate value 2517 of LDI or SUBI insn. */3040 of LDI or SUBI insn. */ 2518 3041 BFD_RELOC_AVR_HH8_LDI_NEG, 2519 3042 2520 3043 /* This is a 16 bit reloc for the AVR that stores 8 bit value (usually 2521 command address) into 8 bit immediate value of LDI insn. */3044 command address) into 8 bit immediate value of LDI insn. */ 2522 3045 BFD_RELOC_AVR_LO8_LDI_PM, 2523 3046 2524 3047 /* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit 2525 of command address) into 8 bit immediate value of LDI insn. */3048 of command address) into 8 bit immediate value of LDI insn. */ 2526 3049 BFD_RELOC_AVR_HI8_LDI_PM, 2527 3050 2528 3051 /* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit 2529 of command address) into 8 bit immediate value of LDI insn. */3052 of command address) into 8 bit immediate value of LDI insn. */ 2530 3053 BFD_RELOC_AVR_HH8_LDI_PM, 2531 3054 2532 3055 /* This is a 16 bit reloc for the AVR that stores negated 8 bit value 2533 (usually command address) into 8 bit immediate value of SUBI insn. */3056 (usually command address) into 8 bit immediate value of SUBI insn. */ 2534 3057 BFD_RELOC_AVR_LO8_LDI_PM_NEG, 2535 3058 2536 3059 /* This is a 16 bit reloc for the AVR that stores negated 8 bit value 2537 3060 (high 8 bit of 16 bit command address) into 8 bit immediate value 2538 of SUBI insn. */3061 of SUBI insn. */ 2539 3062 BFD_RELOC_AVR_HI8_LDI_PM_NEG, 2540 3063 2541 3064 /* This is a 16 bit reloc for the AVR that stores negated 8 bit value 2542 3065 (high 6 bit of 22 bit command address) into 8 bit immediate 2543 value of SUBI insn. */3066 value of SUBI insn. */ 2544 3067 BFD_RELOC_AVR_HH8_LDI_PM_NEG, 2545 3068 2546 3069 /* This is a 32 bit reloc for the AVR that stores 23 bit value 2547 into 22 bits. */3070 into 22 bits. */ 2548 3071 BFD_RELOC_AVR_CALL, 3072 3073 /* Direct 12 bit. */ 3074 BFD_RELOC_390_12, 3075 3076 /* 12 bit GOT offset. */ 3077 BFD_RELOC_390_GOT12, 3078 3079 /* 32 bit PC relative PLT address. */ 3080 BFD_RELOC_390_PLT32, 3081 3082 /* Copy symbol at runtime. */ 3083 BFD_RELOC_390_COPY, 3084 3085 /* Create GOT entry. */ 3086 BFD_RELOC_390_GLOB_DAT, 3087 3088 /* Create PLT entry. */ 3089 BFD_RELOC_390_JMP_SLOT, 3090 3091 /* Adjust by program base. */ 3092 BFD_RELOC_390_RELATIVE, 3093 3094 /* 32 bit PC relative offset to GOT. */ 3095 BFD_RELOC_390_GOTPC, 3096 3097 /* 16 bit GOT offset. */ 3098 BFD_RELOC_390_GOT16, 3099 3100 /* PC relative 16 bit shifted by 1. */ 3101 BFD_RELOC_390_PC16DBL, 3102 3103 /* 16 bit PC rel. PLT shifted by 1. */ 3104 BFD_RELOC_390_PLT16DBL, 3105 3106 /* PC relative 32 bit shifted by 1. */ 3107 BFD_RELOC_390_PC32DBL, 3108 3109 /* 32 bit PC rel. PLT shifted by 1. */ 3110 BFD_RELOC_390_PLT32DBL, 3111 3112 /* 32 bit PC rel. GOT shifted by 1. */ 3113 BFD_RELOC_390_GOTPCDBL, 3114 3115 /* 64 bit GOT offset. */ 3116 BFD_RELOC_390_GOT64, 3117 3118 /* 64 bit PC relative PLT address. */ 3119 BFD_RELOC_390_PLT64, 3120 3121 /* 32 bit rel. offset to GOT entry. */ 3122 BFD_RELOC_390_GOTENT, 3123 3124 /* 64 bit offset to GOT. */ 3125 BFD_RELOC_390_GOTOFF64, 3126 3127 /* 12-bit offset to symbol-entry within GOT, with PLT handling. */ 3128 BFD_RELOC_390_GOTPLT12, 3129 3130 /* 16-bit offset to symbol-entry within GOT, with PLT handling. */ 3131 BFD_RELOC_390_GOTPLT16, 3132 3133 /* 32-bit offset to symbol-entry within GOT, with PLT handling. */ 3134 BFD_RELOC_390_GOTPLT32, 3135 3136 /* 64-bit offset to symbol-entry within GOT, with PLT handling. */ 3137 BFD_RELOC_390_GOTPLT64, 3138 3139 /* 32-bit rel. offset to symbol-entry within GOT, with PLT handling. */ 3140 BFD_RELOC_390_GOTPLTENT, 3141 3142 /* 16-bit rel. offset from the GOT to a PLT entry. */ 3143 BFD_RELOC_390_PLTOFF16, 3144 3145 /* 32-bit rel. offset from the GOT to a PLT entry. */ 3146 BFD_RELOC_390_PLTOFF32, 3147 3148 /* 64-bit rel. offset from the GOT to a PLT entry. */ 3149 BFD_RELOC_390_PLTOFF64, 3150 3151 /* s390 tls relocations. */ 3152 BFD_RELOC_390_TLS_LOAD, 3153 BFD_RELOC_390_TLS_GDCALL, 3154 BFD_RELOC_390_TLS_LDCALL, 3155 BFD_RELOC_390_TLS_GD32, 3156 BFD_RELOC_390_TLS_GD64, 3157 BFD_RELOC_390_TLS_GOTIE12, 3158 BFD_RELOC_390_TLS_GOTIE32, 3159 BFD_RELOC_390_TLS_GOTIE64, 3160 BFD_RELOC_390_TLS_LDM32, 3161 BFD_RELOC_390_TLS_LDM64, 3162 BFD_RELOC_390_TLS_IE32, 3163 BFD_RELOC_390_TLS_IE64, 3164 BFD_RELOC_390_TLS_IEENT, 3165 BFD_RELOC_390_TLS_LE32, 3166 BFD_RELOC_390_TLS_LE64, 3167 BFD_RELOC_390_TLS_LDO32, 3168 BFD_RELOC_390_TLS_LDO64, 3169 BFD_RELOC_390_TLS_DTPMOD, 3170 BFD_RELOC_390_TLS_DTPOFF, 3171 BFD_RELOC_390_TLS_TPOFF, 3172 3173 /* Scenix IP2K - 9-bit register number / data address */ 3174 BFD_RELOC_IP2K_FR9, 3175 3176 /* Scenix IP2K - 4-bit register/data bank number */ 3177 BFD_RELOC_IP2K_BANK, 3178 3179 /* Scenix IP2K - low 13 bits of instruction word address */ 3180 BFD_RELOC_IP2K_ADDR16CJP, 3181 3182 /* Scenix IP2K - high 3 bits of instruction word address */ 3183 BFD_RELOC_IP2K_PAGE3, 3184 3185 /* Scenix IP2K - ext/low/high 8 bits of data address */ 3186 BFD_RELOC_IP2K_LO8DATA, 3187 BFD_RELOC_IP2K_HI8DATA, 3188 BFD_RELOC_IP2K_EX8DATA, 3189 3190 /* Scenix IP2K - low/high 8 bits of instruction word address */ 3191 BFD_RELOC_IP2K_LO8INSN, 3192 BFD_RELOC_IP2K_HI8INSN, 3193 3194 /* Scenix IP2K - even/odd PC modifier to modify snb pcl.0 */ 3195 BFD_RELOC_IP2K_PC_SKIP, 3196 3197 /* Scenix IP2K - 16 bit word address in text section. */ 3198 BFD_RELOC_IP2K_TEXT, 3199 3200 /* Scenix IP2K - 7-bit sp or dp offset */ 3201 BFD_RELOC_IP2K_FR_OFFSET, 3202 3203 /* Scenix VPE4K coprocessor - data/insn-space addressing */ 3204 BFD_RELOC_VPE4KMATH_DATA, 3205 BFD_RELOC_VPE4KMATH_INSN, 2549 3206 2550 3207 /* These two relocations are used by the linker to determine which of … … 2564 3221 describes the entry that is being used. For Rela hosts, this offset 2565 3222 is stored in the reloc's addend. For Rel hosts, we are forced to put 2566 this offset in the reloc's section offset. */3223 this offset in the reloc's section offset. */ 2567 3224 BFD_RELOC_VTABLE_INHERIT, 2568 3225 BFD_RELOC_VTABLE_ENTRY, 2569 3226 2570 /* Intel IA64 Relocations. */3227 /* Intel IA64 Relocations. */ 2571 3228 BFD_RELOC_IA64_IMM14, 2572 3229 BFD_RELOC_IA64_IMM22, … … 2606 3263 BFD_RELOC_IA64_LTOFF_FPTR22, 2607 3264 BFD_RELOC_IA64_LTOFF_FPTR64I, 3265 BFD_RELOC_IA64_LTOFF_FPTR32MSB, 3266 BFD_RELOC_IA64_LTOFF_FPTR32LSB, 2608 3267 BFD_RELOC_IA64_LTOFF_FPTR64MSB, 2609 3268 BFD_RELOC_IA64_LTOFF_FPTR64LSB, … … 2627 3286 BFD_RELOC_IA64_IPLTLSB, 2628 3287 BFD_RELOC_IA64_COPY, 3288 BFD_RELOC_IA64_LTOFF22X, 3289 BFD_RELOC_IA64_LDXMOV, 3290 BFD_RELOC_IA64_TPREL14, 2629 3291 BFD_RELOC_IA64_TPREL22, 3292 BFD_RELOC_IA64_TPREL64I, 2630 3293 BFD_RELOC_IA64_TPREL64MSB, 2631 3294 BFD_RELOC_IA64_TPREL64LSB, 2632 BFD_RELOC_IA64_LTOFF_TP22, 2633 BFD_RELOC_IA64_LTOFF22X, 2634 BFD_RELOC_IA64_LDXMOV, 3295 BFD_RELOC_IA64_LTOFF_TPREL22, 3296 BFD_RELOC_IA64_DTPMOD64MSB, 3297 BFD_RELOC_IA64_DTPMOD64LSB, 3298 BFD_RELOC_IA64_LTOFF_DTPMOD22, 3299 BFD_RELOC_IA64_DTPREL14, 3300 BFD_RELOC_IA64_DTPREL22, 3301 BFD_RELOC_IA64_DTPREL64I, 3302 BFD_RELOC_IA64_DTPREL32MSB, 3303 BFD_RELOC_IA64_DTPREL32LSB, 3304 BFD_RELOC_IA64_DTPREL64MSB, 3305 BFD_RELOC_IA64_DTPREL64LSB, 3306 BFD_RELOC_IA64_LTOFF_DTPREL22, 2635 3307 2636 3308 /* Motorola 68HC11 reloc. 2637 This is the 8 bit s high part of an absolute address.*/3309 This is the 8 bit high part of an absolute address. */ 2638 3310 BFD_RELOC_M68HC11_HI8, 2639 3311 2640 3312 /* Motorola 68HC11 reloc. 2641 This is the 8 bit s low part of an absolute address.*/3313 This is the 8 bit low part of an absolute address. */ 2642 3314 BFD_RELOC_M68HC11_LO8, 2643 3315 2644 3316 /* Motorola 68HC11 reloc. 2645 This is the 3 bit s of a value.*/3317 This is the 3 bit of a value. */ 2646 3318 BFD_RELOC_M68HC11_3B, 2647 3319 3320 /* Motorola 68HC11 reloc. 3321 This reloc marks the beginning of a jump/call instruction. 3322 It is used for linker relaxation to correctly identify beginning 3323 of instruction and change some branchs to use PC-relative 3324 addressing mode. */ 3325 BFD_RELOC_M68HC11_RL_JUMP, 3326 3327 /* Motorola 68HC11 reloc. 3328 This reloc marks a group of several instructions that gcc generates 3329 and for which the linker relaxation pass can modify and/or remove 3330 some of them. */ 3331 BFD_RELOC_M68HC11_RL_GROUP, 3332 3333 /* Motorola 68HC11 reloc. 3334 This is the 16-bit lower part of an address. It is used for 'call' 3335 instruction to specify the symbol address without any special 3336 transformation (due to memory bank window). */ 3337 BFD_RELOC_M68HC11_LO16, 3338 3339 /* Motorola 68HC11 reloc. 3340 This is a 8-bit reloc that specifies the page number of an address. 3341 It is used by 'call' instruction to specify the page number of 3342 the symbol. */ 3343 BFD_RELOC_M68HC11_PAGE, 3344 3345 /* Motorola 68HC11 reloc. 3346 This is a 24-bit reloc that represents the address with a 16-bit 3347 value and a 8-bit page number. The symbol address is transformed 3348 to follow the 16K memory bank of 68HC12 (seen as mapped in the window). */ 3349 BFD_RELOC_M68HC11_24, 3350 2648 3351 /* These relocs are only used within the CRIS assembler. They are not 2649 (at present) written to any object files. */3352 (at present) written to any object files. */ 2650 3353 BFD_RELOC_CRIS_BDISP8, 2651 3354 BFD_RELOC_CRIS_UNSIGNED_5, … … 2654 3357 BFD_RELOC_CRIS_UNSIGNED_4, 2655 3358 2656 /* Intel i860 Relocations. */ 3359 /* Relocs used in ELF shared libraries for CRIS. */ 3360 BFD_RELOC_CRIS_COPY, 3361 BFD_RELOC_CRIS_GLOB_DAT, 3362 BFD_RELOC_CRIS_JUMP_SLOT, 3363 BFD_RELOC_CRIS_RELATIVE, 3364 3365 /* 32-bit offset to symbol-entry within GOT. */ 3366 BFD_RELOC_CRIS_32_GOT, 3367 3368 /* 16-bit offset to symbol-entry within GOT. */ 3369 BFD_RELOC_CRIS_16_GOT, 3370 3371 /* 32-bit offset to symbol-entry within GOT, with PLT handling. */ 3372 BFD_RELOC_CRIS_32_GOTPLT, 3373 3374 /* 16-bit offset to symbol-entry within GOT, with PLT handling. */ 3375 BFD_RELOC_CRIS_16_GOTPLT, 3376 3377 /* 32-bit offset to symbol, relative to GOT. */ 3378 BFD_RELOC_CRIS_32_GOTREL, 3379 3380 /* 32-bit offset to symbol with PLT entry, relative to GOT. */ 3381 BFD_RELOC_CRIS_32_PLT_GOTREL, 3382 3383 /* 32-bit offset to symbol with PLT entry, relative to this relocation. */ 3384 BFD_RELOC_CRIS_32_PLT_PCREL, 3385 3386 /* Intel i860 Relocations. */ 2657 3387 BFD_RELOC_860_COPY, 2658 3388 BFD_RELOC_860_GLOB_DAT, … … 2687 3417 BFD_RELOC_860_HIGOT, 2688 3418 BFD_RELOC_860_HIGOTOFF, 3419 3420 /* OpenRISC Relocations. */ 3421 BFD_RELOC_OPENRISC_ABS_26, 3422 BFD_RELOC_OPENRISC_REL_26, 3423 3424 /* H8 elf Relocations. */ 3425 BFD_RELOC_H8_DIR16A8, 3426 BFD_RELOC_H8_DIR16R8, 3427 BFD_RELOC_H8_DIR24A8, 3428 BFD_RELOC_H8_DIR24R8, 3429 BFD_RELOC_H8_DIR32A16, 3430 3431 /* Sony Xstormy16 Relocations. */ 3432 BFD_RELOC_XSTORMY16_REL_12, 3433 BFD_RELOC_XSTORMY16_12, 3434 BFD_RELOC_XSTORMY16_24, 3435 BFD_RELOC_XSTORMY16_FPTR16, 3436 3437 /* Relocations used by VAX ELF. */ 3438 BFD_RELOC_VAX_GLOB_DAT, 3439 BFD_RELOC_VAX_JMP_SLOT, 3440 BFD_RELOC_VAX_RELATIVE, 3441 3442 /* msp430 specific relocation codes */ 3443 BFD_RELOC_MSP430_10_PCREL, 3444 BFD_RELOC_MSP430_16_PCREL, 3445 BFD_RELOC_MSP430_16, 3446 BFD_RELOC_MSP430_16_PCREL_BYTE, 3447 BFD_RELOC_MSP430_16_BYTE, 3448 3449 /* IQ2000 Relocations. */ 3450 BFD_RELOC_IQ2000_OFFSET_16, 3451 BFD_RELOC_IQ2000_OFFSET_21, 3452 BFD_RELOC_IQ2000_UHI16, 3453 3454 /* Special Xtensa relocation used only by PLT entries in ELF shared 3455 objects to indicate that the runtime linker should set the value 3456 to one of its own internal functions or data structures. */ 3457 BFD_RELOC_XTENSA_RTLD, 3458 3459 /* Xtensa relocations for ELF shared objects. */ 3460 BFD_RELOC_XTENSA_GLOB_DAT, 3461 BFD_RELOC_XTENSA_JMP_SLOT, 3462 BFD_RELOC_XTENSA_RELATIVE, 3463 3464 /* Xtensa relocation used in ELF object files for symbols that may require 3465 PLT entries. Otherwise, this is just a generic 32-bit relocation. */ 3466 BFD_RELOC_XTENSA_PLT, 3467 3468 /* Generic Xtensa relocations. Only the operand number is encoded 3469 in the relocation. The details are determined by extracting the 3470 instruction opcode. */ 3471 BFD_RELOC_XTENSA_OP0, 3472 BFD_RELOC_XTENSA_OP1, 3473 BFD_RELOC_XTENSA_OP2, 3474 3475 /* Xtensa relocation to mark that the assembler expanded the 3476 instructions from an original target. The expansion size is 3477 encoded in the reloc size. */ 3478 BFD_RELOC_XTENSA_ASM_EXPAND, 3479 3480 /* Xtensa relocation to mark that the linker should simplify 3481 assembler-expanded instructions. This is commonly used 3482 internally by the linker after analysis of a 3483 BFD_RELOC_XTENSA_ASM_EXPAND. */ 3484 BFD_RELOC_XTENSA_ASM_SIMPLIFY, 2689 3485 BFD_RELOC_UNUSED }; 2690 3486 typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; … … 2695 3491 bfd_get_reloc_code_name PARAMS ((bfd_reloc_code_real_type code)); 2696 3492 3493 /* Extracted from syms.c. */ 2697 3494 2698 3495 typedef struct symbol_cache_entry 2699 3496 { 2700 /* A pointer to the BFD which owns the symbol. This information 2701 is necessary so that a back end can work out what additional 2702 information (invisible to the application writer) is carried 2703 with the symbol. 2704 2705 This field is *almost* redundant, since you can use section->owner 2706 instead, except that some symbols point to the global sections 2707 bfd_{abs,com,und}_section. This could be fixed by making 2708 these globals be per-bfd (or per-target-flavor). FIXME. */ 2709 2710 struct _bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field. */ 2711 2712 /* The text of the symbol. The name is left alone, and not copied; the 2713 application may not alter it. */ 2714 CONST char *name; 2715 2716 /* The value of the symbol. This really should be a union of a 2717 numeric value with a pointer, since some flags indicate that 2718 a pointer to another symbol is stored here. */ 3497 /* A pointer to the BFD which owns the symbol. This information 3498 is necessary so that a back end can work out what additional 3499 information (invisible to the application writer) is carried 3500 with the symbol. 3501 3502 This field is *almost* redundant, since you can use section->owner 3503 instead, except that some symbols point to the global sections 3504 bfd_{abs,com,und}_section. This could be fixed by making 3505 these globals be per-bfd (or per-target-flavor). FIXME. */ 3506 struct bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field. */ 3507 3508 /* The text of the symbol. The name is left alone, and not copied; the 3509 application may not alter it. */ 3510 const char *name; 3511 3512 /* The value of the symbol. This really should be a union of a 3513 numeric value with a pointer, since some flags indicate that 3514 a pointer to another symbol is stored here. */ 2719 3515 symvalue value; 2720 3516 2721 /* Attributes of a symbol: */ 2722 3517 /* Attributes of a symbol. */ 2723 3518 #define BSF_NO_FLAGS 0x00 2724 3519 2725 2726 is the offset into the section of the data.*/3520 /* The symbol has local scope; <<static>> in <<C>>. The value 3521 is the offset into the section of the data. */ 2727 3522 #define BSF_LOCAL 0x01 2728 3523 2729 2730 value is the offset into the section of the data.*/3524 /* The symbol has global scope; initialized data in <<C>>. The 3525 value is the offset into the section of the data. */ 2731 3526 #define BSF_GLOBAL 0x02 2732 3527 2733 2734 the offset into the section of the data.*/2735 #define BSF_EXPORT BSF_GLOBAL /* no real difference*/2736 2737 2738 2739 <<BSF_GLOBAL>>*/2740 2741 2742 3528 /* The symbol has global scope and is exported. The value is 3529 the offset into the section of the data. */ 3530 #define BSF_EXPORT BSF_GLOBAL /* No real difference. */ 3531 3532 /* A normal C symbol would be one of: 3533 <<BSF_LOCAL>>, <<BSF_FORT_COMM>>, <<BSF_UNDEFINED>> or 3534 <<BSF_GLOBAL>>. */ 3535 3536 /* The symbol is a debugging record. The value has an arbitary 3537 meaning, unless BSF_DEBUGGING_RELOC is also set. */ 2743 3538 #define BSF_DEBUGGING 0x08 2744 3539 2745 2746 3540 /* The symbol denotes a function entry point. Used in ELF, 3541 perhaps others someday. */ 2747 3542 #define BSF_FUNCTION 0x10 2748 3543 2749 /* Used by the linker.*/3544 /* Used by the linker. */ 2750 3545 #define BSF_KEEP 0x20 2751 3546 #define BSF_KEEP_G 0x40 2752 3547 2753 2754 3548 /* A weak global symbol, overridable without warnings by 3549 a regular global symbol of the same name. */ 2755 3550 #define BSF_WEAK 0x80 2756 3551 2757 2758 3552 /* This symbol was created to point to a section, e.g. ELF's 3553 STT_SECTION symbols. */ 2759 3554 #define BSF_SECTION_SYM 0x100 2760 3555 2761 2762 allocated.*/3556 /* The symbol used to be a common symbol, but now it is 3557 allocated. */ 2763 3558 #define BSF_OLD_COMMON 0x200 2764 3559 2765 /* The default value for common data.*/3560 /* The default value for common data. */ 2766 3561 #define BFD_FORT_COMM_DEFAULT_VALUE 0 2767 3562 2768 /* In some files the type of a symbol sometimes alters its 2769 location in an output file - ie in coff a <<ISFCN>> symbol 2770 which is also <<C_EXT>> symbol appears where it was 2771 declared and not at the end of a section. This bit is set 2772 by the target BFD part to convey this information. */ 2773 3563 /* In some files the type of a symbol sometimes alters its 3564 location in an output file - ie in coff a <<ISFCN>> symbol 3565 which is also <<C_EXT>> symbol appears where it was 3566 declared and not at the end of a section. This bit is set 3567 by the target BFD part to convey this information. */ 2774 3568 #define BSF_NOT_AT_END 0x400 2775 3569 2776 /* Signal that the symbol is the label of constructor section.*/3570 /* Signal that the symbol is the label of constructor section. */ 2777 3571 #define BSF_CONSTRUCTOR 0x800 2778 3572 2779 2780 2781 2782 symbol, a warning is issued by the linker.*/3573 /* Signal that the symbol is a warning symbol. The name is a 3574 warning. The name of the next symbol is the one to warn about; 3575 if a reference is made to a symbol with the same name as the next 3576 symbol, a warning is issued by the linker. */ 2783 3577 #define BSF_WARNING 0x1000 2784 3578 2785 2786 pointer to the symbol with the same name as the next symbol.*/3579 /* Signal that the symbol is indirect. This symbol is an indirect 3580 pointer to the symbol with the same name as the next symbol. */ 2787 3581 #define BSF_INDIRECT 0x2000 2788 3582 2789 2790 3583 /* BSF_FILE marks symbols that contain a file name. This is used 3584 for ELF STT_FILE symbols. */ 2791 3585 #define BSF_FILE 0x4000 2792 3586 2793 3587 /* Symbol is from dynamic linking information. */ 2794 3588 #define BSF_DYNAMIC 0x8000 2795 3589 2796 2797 3590 /* The symbol denotes a data object. Used in ELF, and perhaps 3591 others someday. */ 2798 3592 #define BSF_OBJECT 0x10000 2799 3593 2800 2801 2802 3594 /* This symbol is a debugging symbol. The value is the offset 3595 into the section of the data. BSF_DEBUGGING should be set 3596 as well. */ 2803 3597 #define BSF_DEBUGGING_RELOC 0x20000 2804 3598 2805 /* Symbol is an emx import reference. */ 3599 /* This symbol is thread local. Used in ELF. */ 3600 #define BSF_THREAD_LOCAL 0x40000 3601 3602 /* Symbol is an emx import reference. */ 2806 3603 #define BSF_EMX_IMPORT1 0x20000000 2807 3604 2808 3605 /* Symbol is an emx import definition. */ 2809 3606 #define BSF_EMX_IMPORT2 0x40000000 2810 3607 2811 3608 flagword flags; 2812 3609 2813 2814 2815 3610 /* A pointer to the section to which this symbol is 3611 relative. This will always be non NULL, there are special 3612 sections for undefined and absolute symbols. */ 2816 3613 struct sec *section; 2817 3614 2818 3615 /* Back end special data. */ 2819 3616 union 2820 3617 { 2821 3618 PTR p; 2822 3619 bfd_vma i; 2823 } udata; 2824 2825 } asymbol; 3620 } 3621 udata; 3622 } 3623 asymbol; 3624 2826 3625 #define bfd_get_symtab_upper_bound(abfd) \ 2827 3626 BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) 2828 boolean 3627 3628 bfd_boolean 2829 3629 bfd_is_local_label PARAMS ((bfd *abfd, asymbol *sym)); 2830 3630 2831 b oolean3631 bfd_boolean 2832 3632 bfd_is_local_label_name PARAMS ((bfd *abfd, const char *name)); 2833 3633 2834 3634 #define bfd_is_local_label_name(abfd, name) \ 2835 3635 BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) 3636 2836 3637 #define bfd_canonicalize_symtab(abfd, location) \ 2837 3638 BFD_SEND (abfd, _bfd_canonicalize_symtab,\ 2838 3639 (abfd, location)) 2839 boolean 3640 3641 bfd_boolean 2840 3642 bfd_set_symtab PARAMS ((bfd *abfd, asymbol **location, unsigned int count)); 2841 3643 2842 3644 void 2843 bfd_print_symbol_vandf PARAMS (( PTR file, asymbol *symbol));3645 bfd_print_symbol_vandf PARAMS ((bfd *abfd, PTR file, asymbol *symbol)); 2844 3646 2845 3647 #define bfd_make_empty_symbol(abfd) \ 2846 3648 BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) 3649 3650 asymbol * 3651 _bfd_generic_make_empty_symbol PARAMS ((bfd *)); 3652 2847 3653 #define bfd_make_debug_symbol(abfd,ptr,size) \ 2848 3654 BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) 3655 2849 3656 int 2850 3657 bfd_decode_symclass PARAMS ((asymbol *symbol)); 2851 3658 2852 b oolean3659 bfd_boolean 2853 3660 bfd_is_undefined_symclass PARAMS ((int symclass)); 2854 3661 … … 2856 3663 bfd_symbol_info PARAMS ((asymbol *symbol, symbol_info *ret)); 2857 3664 2858 b oolean3665 bfd_boolean 2859 3666 bfd_copy_private_symbol_data PARAMS ((bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym)); 2860 3667 … … 2862 3669 BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ 2863 3670 (ibfd, isymbol, obfd, osymbol)) 2864 struct _bfd 3671 3672 /* Extracted from bfd.c. */ 3673 struct bfd 2865 3674 { 2866 /* The filename the application opened the BFD with. */ 2867 CONST char *filename; 2868 2869 /* A pointer to the target jump table. */ 2870 const struct bfd_target *xvec; 2871 2872 /* To avoid dragging too many header files into every file that 2873 includes `<<bfd.h>>', IOSTREAM has been declared as a "char 2874 *", and MTIME as a "long". Their correct types, to which they 2875 are cast when used, are "FILE *" and "time_t". The iostream 2876 is the result of an fopen on the filename. However, if the 2877 BFD_IN_MEMORY flag is set, then iostream is actually a pointer 2878 to a bfd_in_memory struct. */ 2879 PTR iostream; 2880 2881 /* Is the file descriptor being cached? That is, can it be closed as 2882 needed, and re-opened when accessed later? */ 2883 2884 boolean cacheable; 2885 2886 /* Marks whether there was a default target specified when the 2887 BFD was opened. This is used to select which matching algorithm 2888 to use to choose the back end. */ 2889 2890 boolean target_defaulted; 2891 2892 /* The caching routines use these to maintain a 2893 least-recently-used list of BFDs */ 2894 2895 struct _bfd *lru_prev, *lru_next; 2896 2897 /* When a file is closed by the caching routines, BFD retains 2898 state information on the file here: */ 2899 2900 file_ptr where; 2901 2902 /* and here: (``once'' means at least once) */ 2903 2904 boolean opened_once; 2905 2906 /* Set if we have a locally maintained mtime value, rather than 2907 getting it from the file each time: */ 2908 2909 boolean mtime_set; 2910 2911 /* File modified time, if mtime_set is true: */ 2912 2913 long mtime; 2914 2915 /* Reserved for an unimplemented file locking extension.*/ 2916 2917 int ifd; 2918 2919 /* The format which belongs to the BFD. (object, core, etc.) */ 2920 2921 bfd_format format; 2922 2923 /* The direction the BFD was opened with*/ 2924 2925 enum bfd_direction {no_direction = 0, 2926 read_direction = 1, 2927 write_direction = 2, 2928 both_direction = 3} direction; 2929 2930 /* Format_specific flags*/ 2931 2932 flagword flags; 2933 2934 /* Currently my_archive is tested before adding origin to 2935 anything. I believe that this can become always an add of 2936 origin, with origin set to 0 for non archive files. */ 2937 2938 file_ptr origin; 2939 2940 /* Remember when output has begun, to stop strange things 2941 from happening. */ 2942 boolean output_has_begun; 2943 2944 /* Pointer to linked list of sections*/ 2945 struct sec *sections; 2946 2947 /* The number of sections */ 2948 unsigned int section_count; 2949 2950 /* Stuff only useful for object files: 2951 The start address. */ 2952 bfd_vma start_address; 2953 2954 /* Used for input and output*/ 2955 unsigned int symcount; 2956 2957 /* Symbol table for output BFD (with symcount entries) */ 2958 struct symbol_cache_entry **outsymbols; 2959 2960 /* Pointer to structure which contains architecture information*/ 2961 const struct bfd_arch_info *arch_info; 2962 2963 /* Stuff only useful for archives:*/ 2964 PTR arelt_data; 2965 struct _bfd *my_archive; /* The containing archive BFD. */ 2966 struct _bfd *next; /* The next BFD in the archive. */ 2967 struct _bfd *archive_head; /* The first BFD in the archive. */ 2968 boolean has_armap; 2969 2970 /* A chain of BFD structures involved in a link. */ 2971 struct _bfd *link_next; 2972 2973 /* A field used by _bfd_generic_link_add_archive_symbols. This will 2974 be used only for archive elements. */ 2975 int archive_pass; 2976 2977 /* Used by the back end to hold private data. */ 2978 2979 union 2980 { 3675 /* A unique identifier of the BFD */ 3676 unsigned int id; 3677 3678 /* The filename the application opened the BFD with. */ 3679 const char *filename; 3680 3681 /* A pointer to the target jump table. */ 3682 const struct bfd_target *xvec; 3683 3684 /* To avoid dragging too many header files into every file that 3685 includes `<<bfd.h>>', IOSTREAM has been declared as a "char *", 3686 and MTIME as a "long". Their correct types, to which they 3687 are cast when used, are "FILE *" and "time_t". The iostream 3688 is the result of an fopen on the filename. However, if the 3689 BFD_IN_MEMORY flag is set, then iostream is actually a pointer 3690 to a bfd_in_memory struct. */ 3691 PTR iostream; 3692 3693 /* Is the file descriptor being cached? That is, can it be closed as 3694 needed, and re-opened when accessed later? */ 3695 bfd_boolean cacheable; 3696 3697 /* Marks whether there was a default target specified when the 3698 BFD was opened. This is used to select which matching algorithm 3699 to use to choose the back end. */ 3700 bfd_boolean target_defaulted; 3701 3702 /* The caching routines use these to maintain a 3703 least-recently-used list of BFDs. */ 3704 struct bfd *lru_prev, *lru_next; 3705 3706 /* When a file is closed by the caching routines, BFD retains 3707 state information on the file here... */ 3708 ufile_ptr where; 3709 3710 /* ... and here: (``once'' means at least once). */ 3711 bfd_boolean opened_once; 3712 3713 /* Set if we have a locally maintained mtime value, rather than 3714 getting it from the file each time. */ 3715 bfd_boolean mtime_set; 3716 3717 /* File modified time, if mtime_set is TRUE. */ 3718 long mtime; 3719 3720 /* Reserved for an unimplemented file locking extension. */ 3721 int ifd; 3722 3723 /* The format which belongs to the BFD. (object, core, etc.) */ 3724 bfd_format format; 3725 3726 /* The direction with which the BFD was opened. */ 3727 enum bfd_direction 3728 { 3729 no_direction = 0, 3730 read_direction = 1, 3731 write_direction = 2, 3732 both_direction = 3 3733 } 3734 direction; 3735 3736 /* Format_specific flags. */ 3737 flagword flags; 3738 3739 /* Currently my_archive is tested before adding origin to 3740 anything. I believe that this can become always an add of 3741 origin, with origin set to 0 for non archive files. */ 3742 ufile_ptr origin; 3743 3744 /* Remember when output has begun, to stop strange things 3745 from happening. */ 3746 bfd_boolean output_has_begun; 3747 3748 /* A hash table for section names. */ 3749 struct bfd_hash_table section_htab; 3750 3751 /* Pointer to linked list of sections. */ 3752 struct sec *sections; 3753 3754 /* The place where we add to the section list. */ 3755 struct sec **section_tail; 3756 3757 /* The number of sections. */ 3758 unsigned int section_count; 3759 3760 /* Stuff only useful for object files: 3761 The start address. */ 3762 bfd_vma start_address; 3763 3764 /* Used for input and output. */ 3765 unsigned int symcount; 3766 3767 /* Symbol table for output BFD (with symcount entries). */ 3768 struct symbol_cache_entry **outsymbols; 3769 3770 /* Used for slurped dynamic symbol tables. */ 3771 unsigned int dynsymcount; 3772 3773 /* Pointer to structure which contains architecture information. */ 3774 const struct bfd_arch_info *arch_info; 3775 3776 /* Stuff only useful for archives. */ 3777 PTR arelt_data; 3778 struct bfd *my_archive; /* The containing archive BFD. */ 3779 struct bfd *next; /* The next BFD in the archive. */ 3780 struct bfd *archive_head; /* The first BFD in the archive. */ 3781 bfd_boolean has_armap; 3782 3783 /* A chain of BFD structures involved in a link. */ 3784 struct bfd *link_next; 3785 3786 /* A field used by _bfd_generic_link_add_archive_symbols. This will 3787 be used only for archive elements. */ 3788 int archive_pass; 3789 3790 /* Used by the back end to hold private data. */ 3791 union 3792 { 2981 3793 struct aout_data_struct *aout_data; 2982 3794 struct artdata *aout_ar_data; … … 2995 3807 struct nlm_obj_tdata *nlm_obj_data; 2996 3808 struct bout_data_struct *bout_data; 3809 struct mmo_data_struct *mmo_data; 2997 3810 struct sun_core_struct *sun_core_data; 2998 3811 struct sco5_core_struct *sco5_core_data; … … 3007 3820 struct versados_data_struct *versados_data; 3008 3821 struct netbsd_core_struct *netbsd_core_data; 3822 struct mach_o_data_struct *mach_o_data; 3823 struct mach_o_fat_data_struct *mach_o_fat_data; 3824 struct bfd_pef_data_struct *pef_data; 3825 struct bfd_pef_xlib_data_struct *pef_xlib_data; 3826 struct bfd_sym_data_struct *sym_data; 3009 3827 PTR any; 3010 } tdata; 3011 3012 /* Used by the application to hold private data*/ 3013 PTR usrdata; 3828 } 3829 tdata; 3830 3831 /* Used by the application to hold private data. */ 3832 PTR usrdata; 3014 3833 3015 3834 /* Where all the allocated stuff under this BFD goes. This is a 3016 3835 struct objalloc *, but we use PTR to avoid requiring the inclusion of 3017 3836 objalloc.h. */ 3018 3837 PTR memory; 3019 3838 }; 3020 3839 … … 3025 3844 bfd_error_invalid_target, 3026 3845 bfd_error_wrong_format, 3846 bfd_error_wrong_object_format, 3027 3847 bfd_error_invalid_operation, 3028 3848 bfd_error_no_memory, … … 3040 3860 bfd_error_file_too_big, 3041 3861 bfd_error_invalid_error_code 3042 } bfd_error_type; 3862 } 3863 bfd_error_type; 3043 3864 3044 3865 bfd_error_type … … 3048 3869 bfd_set_error PARAMS ((bfd_error_type error_tag)); 3049 3870 3050 CONSTchar *3871 const char * 3051 3872 bfd_errmsg PARAMS ((bfd_error_type error_tag)); 3052 3873 3053 3874 void 3054 bfd_perror PARAMS (( CONSTchar *message));3875 bfd_perror PARAMS ((const char *message)); 3055 3876 3056 3877 typedef void (*bfd_error_handler_type) PARAMS ((const char *, ...)); … … 3064 3885 bfd_error_handler_type 3065 3886 bfd_get_error_handler PARAMS ((void)); 3887 3888 const char * 3889 bfd_archive_filename PARAMS ((bfd *)); 3066 3890 3067 3891 long … … 3075 3899 3076 3900 void 3077 bfd_set_reloc PARAMS ((bfd *abfd, asection *sec, arelent **rel, unsigned int count) 3078 3079 ); 3080 3081 boolean 3901 bfd_set_reloc PARAMS ((bfd *abfd, asection *sec, arelent **rel, unsigned int count)); 3902 3903 bfd_boolean 3082 3904 bfd_set_file_flags PARAMS ((bfd *abfd, flagword flags)); 3083 3905 … … 3088 3910 bfd_get_sign_extend_vma PARAMS ((bfd *abfd)); 3089 3911 3090 b oolean3912 bfd_boolean 3091 3913 bfd_set_start_address PARAMS ((bfd *abfd, bfd_vma vma)); 3092 3914 3093 long 3094 bfd_get_mtime PARAMS ((bfd *abfd)); 3095 3096 long 3097 bfd_get_size PARAMS ((bfd *abfd)); 3098 3099 int 3915 unsigned int 3100 3916 bfd_get_gp_size PARAMS ((bfd *abfd)); 3101 3917 3102 3918 void 3103 bfd_set_gp_size PARAMS ((bfd *abfd, int i));3919 bfd_set_gp_size PARAMS ((bfd *abfd, unsigned int i)); 3104 3920 3105 3921 bfd_vma 3106 bfd_scan_vma PARAMS (( CONST char *string, CONSTchar **end, int base));3107 3108 b oolean3922 bfd_scan_vma PARAMS ((const char *string, const char **end, int base)); 3923 3924 bfd_boolean 3109 3925 bfd_copy_private_bfd_data PARAMS ((bfd *ibfd, bfd *obfd)); 3110 3926 … … 3112 3928 BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ 3113 3929 (ibfd, obfd)) 3114 b oolean3930 bfd_boolean 3115 3931 bfd_merge_private_bfd_data PARAMS ((bfd *ibfd, bfd *obfd)); 3116 3932 … … 3118 3934 BFD_SEND (obfd, _bfd_merge_private_bfd_data, \ 3119 3935 (ibfd, obfd)) 3120 b oolean3936 bfd_boolean 3121 3937 bfd_set_private_flags PARAMS ((bfd *abfd, flagword flags)); 3122 3938 3123 3939 #define bfd_set_private_flags(abfd, flags) \ 3124 BFD_SEND (abfd, _bfd_set_private_flags, \ 3125 (abfd, flags)) 3940 BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) 3126 3941 #define bfd_sizeof_headers(abfd, reloc) \ 3127 BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc))3942 BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc)) 3128 3943 3129 3944 #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ 3130 BFD_SEND (abfd, _bfd_find_nearest_line, (abfd, sec, syms, off, file, func, line))3131 3132 /* Do these three do anything useful at all, for any back end? */ 3945 BFD_SEND (abfd, _bfd_find_nearest_line, \ 3946 (abfd, sec, syms, off, file, func, line)) 3947 3133 3948 #define bfd_debug_info_start(abfd) \ 3134 3949 BFD_SEND (abfd, _bfd_debug_info_start, (abfd)) 3135 3950 3136 3951 #define bfd_debug_info_end(abfd) \ 3137 3952 BFD_SEND (abfd, _bfd_debug_info_end, (abfd)) 3138 3953 3139 3954 #define bfd_debug_info_accumulate(abfd, section) \ 3140 BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section)) 3141 3955 BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section)) 3142 3956 3143 3957 #define bfd_stat_arch_elt(abfd, stat) \ 3144 3958 BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat)) 3145 3959 3146 3960 #define bfd_update_armap_timestamp(abfd) \ 3147 3961 BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd)) 3148 3962 3149 3963 #define bfd_set_arch_mach(abfd, arch, mach)\ 3150 3964 BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach)) 3151 3965 3152 3966 #define bfd_relax_section(abfd, section, link_info, again) \ … … 3156 3970 BFD_SEND (abfd, _bfd_gc_sections, (abfd, link_info)) 3157 3971 3972 #define bfd_merge_sections(abfd, link_info) \ 3973 BFD_SEND (abfd, _bfd_merge_sections, (abfd, link_info)) 3974 3975 #define bfd_discard_group(abfd, sec) \ 3976 BFD_SEND (abfd, _bfd_discard_group, (abfd, sec)) 3977 3158 3978 #define bfd_link_hash_table_create(abfd) \ 3159 3979 BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd)) 3160 3980 3981 #define bfd_link_hash_table_free(abfd, hash) \ 3982 BFD_SEND (abfd, _bfd_link_hash_table_free, (hash)) 3983 3161 3984 #define bfd_link_add_symbols(abfd, info) \ 3162 3985 BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info)) 3986 3987 #define bfd_link_just_syms(sec, info) \ 3988 BFD_SEND (abfd, _bfd_link_just_syms, (sec, info)) 3163 3989 3164 3990 #define bfd_final_link(abfd, info) \ … … 3186 4012 PARAMS ((bfd *, struct bfd_link_info *, 3187 4013 struct bfd_link_order *, bfd_byte *, 3188 boolean, asymbol **)); 3189 4014 bfd_boolean, asymbol **)); 4015 4016 bfd_boolean 4017 bfd_alt_mach_code PARAMS ((bfd *abfd, int alternative)); 4018 4019 struct bfd_preserve 4020 { 4021 PTR marker; 4022 PTR tdata; 4023 flagword flags; 4024 const struct bfd_arch_info *arch_info; 4025 struct sec *sections; 4026 struct sec **section_tail; 4027 unsigned int section_count; 4028 struct bfd_hash_table section_htab; 4029 }; 4030 4031 bfd_boolean 4032 bfd_preserve_save PARAMS ((bfd *, struct bfd_preserve *)); 4033 4034 void 4035 bfd_preserve_restore PARAMS ((bfd *, struct bfd_preserve *)); 4036 4037 void 4038 bfd_preserve_finish PARAMS ((bfd *, struct bfd_preserve *)); 4039 4040 /* Extracted from archive.c. */ 3190 4041 symindex 3191 4042 bfd_get_next_mapent PARAMS ((bfd *abfd, symindex previous, carsym **sym)); 3192 4043 3193 b oolean4044 bfd_boolean 3194 4045 bfd_set_archive_head PARAMS ((bfd *output, bfd *new_head)); 3195 4046 … … 3197 4048 bfd_openr_next_archived_file PARAMS ((bfd *archive, bfd *previous)); 3198 4049 3199 CONST char * 4050 /* Extracted from corefile.c. */ 4051 const char * 3200 4052 bfd_core_file_failing_command PARAMS ((bfd *abfd)); 3201 4053 … … 3203 4055 bfd_core_file_failing_signal PARAMS ((bfd *abfd)); 3204 4056 3205 b oolean4057 bfd_boolean 3206 4058 core_file_matches_executable_p PARAMS ((bfd *core_bfd, bfd *exec_bfd)); 3207 4059 4060 /* Extracted from targets.c. */ 3208 4061 #define BFD_SEND(bfd, message, arglist) \ 3209 4062 ((*((bfd)->xvec->message)) arglist) … … 3226 4079 (bfd_assert (__FILE__,__LINE__), NULL)) 3227 4080 #endif 3228 enum bfd_flavour { 4081 4082 enum bfd_flavour 4083 { 3229 4084 bfd_target_unknown_flavour, 3230 4085 bfd_target_aout_flavour, … … 3244 4099 bfd_target_msdos_flavour, 3245 4100 bfd_target_ovax_flavour, 3246 bfd_target_evax_flavour 4101 bfd_target_evax_flavour, 4102 bfd_target_mmo_flavour, 4103 bfd_target_mach_o_flavour, 4104 bfd_target_pef_flavour, 4105 bfd_target_pef_xlib_flavour, 4106 bfd_target_sym_flavour 3247 4107 }; 3248 4108 … … 3254 4114 typedef struct bfd_target 3255 4115 { 4116 /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */ 3256 4117 char *name; 4118 4119 /* The "flavour" of a back end is a general indication about 4120 the contents of a file. */ 3257 4121 enum bfd_flavour flavour; 4122 4123 /* The order of bytes within the data area of a file. */ 3258 4124 enum bfd_endian byteorder; 4125 4126 /* The order of bytes within the header parts of a file. */ 3259 4127 enum bfd_endian header_byteorder; 4128 4129 /* A mask of all the flags which an executable may have set - 4130 from the set <<BFD_NO_FLAGS>>, <<HAS_RELOC>>, ...<<D_PAGED>>. */ 3260 4131 flagword object_flags; 4132 4133 /* A mask of all the flags which a section may have set - from 4134 the set <<SEC_NO_FLAGS>>, <<SEC_ALLOC>>, ...<<SET_NEVER_LOAD>>. */ 3261 4135 flagword section_flags; 4136 4137 /* The character normally found at the front of a symbol. 4138 (if any), perhaps `_'. */ 3262 4139 char symbol_leading_char; 4140 4141 /* The pad character for file names within an archive header. */ 3263 4142 char ar_pad_char; 4143 4144 /* The maximum number of characters in an archive header. */ 3264 4145 unsigned short ar_max_namelen; 3265 bfd_vma (*bfd_getx64) PARAMS ((const bfd_byte *)); 4146 4147 /* Entries for byte swapping for data. These are different from the 4148 other entry points, since they don't take a BFD asthe first argument. 4149 Certain other handlers could do the same. */ 4150 bfd_vma (*bfd_getx64) PARAMS ((const bfd_byte *)); 3266 4151 bfd_signed_vma (*bfd_getx_signed_64) PARAMS ((const bfd_byte *)); 3267 void (*bfd_putx64) PARAMS ((bfd_vma, bfd_byte *));3268 bfd_vma (*bfd_getx32) PARAMS ((const bfd_byte *));4152 void (*bfd_putx64) PARAMS ((bfd_vma, bfd_byte *)); 4153 bfd_vma (*bfd_getx32) PARAMS ((const bfd_byte *)); 3269 4154 bfd_signed_vma (*bfd_getx_signed_32) PARAMS ((const bfd_byte *)); 3270 void (*bfd_putx32) PARAMS ((bfd_vma, bfd_byte *));3271 bfd_vma (*bfd_getx16) PARAMS ((const bfd_byte *));4155 void (*bfd_putx32) PARAMS ((bfd_vma, bfd_byte *)); 4156 bfd_vma (*bfd_getx16) PARAMS ((const bfd_byte *)); 3272 4157 bfd_signed_vma (*bfd_getx_signed_16) PARAMS ((const bfd_byte *)); 3273 void (*bfd_putx16) PARAMS ((bfd_vma, bfd_byte *)); 3274 bfd_vma (*bfd_h_getx64) PARAMS ((const bfd_byte *)); 4158 void (*bfd_putx16) PARAMS ((bfd_vma, bfd_byte *)); 4159 4160 /* Byte swapping for the headers. */ 4161 bfd_vma (*bfd_h_getx64) PARAMS ((const bfd_byte *)); 3275 4162 bfd_signed_vma (*bfd_h_getx_signed_64) PARAMS ((const bfd_byte *)); 3276 void (*bfd_h_putx64) PARAMS ((bfd_vma, bfd_byte *));3277 bfd_vma (*bfd_h_getx32) PARAMS ((const bfd_byte *));4163 void (*bfd_h_putx64) PARAMS ((bfd_vma, bfd_byte *)); 4164 bfd_vma (*bfd_h_getx32) PARAMS ((const bfd_byte *)); 3278 4165 bfd_signed_vma (*bfd_h_getx_signed_32) PARAMS ((const bfd_byte *)); 3279 void (*bfd_h_putx32) PARAMS ((bfd_vma, bfd_byte *));3280 bfd_vma (*bfd_h_getx16) PARAMS ((const bfd_byte *));4166 void (*bfd_h_putx32) PARAMS ((bfd_vma, bfd_byte *)); 4167 bfd_vma (*bfd_h_getx16) PARAMS ((const bfd_byte *)); 3281 4168 bfd_signed_vma (*bfd_h_getx_signed_16) PARAMS ((const bfd_byte *)); 3282 void (*bfd_h_putx16) PARAMS ((bfd_vma, bfd_byte *)); 4169 void (*bfd_h_putx16) PARAMS ((bfd_vma, bfd_byte *)); 4170 4171 /* Format dependent routines: these are vectors of entry points 4172 within the target vector structure, one for each format to check. */ 4173 4174 /* Check the format of a file being read. Return a <<bfd_target *>> or zero. */ 3283 4175 const struct bfd_target *(*_bfd_check_format[bfd_type_end]) PARAMS ((bfd *)); 3284 boolean (*_bfd_set_format[bfd_type_end]) PARAMS ((bfd *)); 3285 boolean (*_bfd_write_contents[bfd_type_end]) PARAMS ((bfd *)); 4176 4177 /* Set the format of a file being written. */ 4178 bfd_boolean (*_bfd_set_format[bfd_type_end]) PARAMS ((bfd *)); 4179 4180 /* Write cached information into a file being written, at <<bfd_close>>. */ 4181 bfd_boolean (*_bfd_write_contents[bfd_type_end]) PARAMS ((bfd *)); 4182 3286 4183 3287 4184 /* Generic entry points. */ 3288 #define BFD_JUMP_TABLE_GENERIC(NAME) \3289 C AT(NAME,_close_and_cleanup),\3290 C AT(NAME,_bfd_free_cached_info),\3291 C AT(NAME,_new_section_hook),\3292 C AT(NAME,_get_section_contents),\3293 C AT(NAME,_get_section_contents_in_window)4185 #define BFD_JUMP_TABLE_GENERIC(NAME) \ 4186 CONCAT2 (NAME,_close_and_cleanup), \ 4187 CONCAT2 (NAME,_bfd_free_cached_info), \ 4188 CONCAT2 (NAME,_new_section_hook), \ 4189 CONCAT2 (NAME,_get_section_contents), \ 4190 CONCAT2 (NAME,_get_section_contents_in_window) 3294 4191 3295 4192 /* Called when the BFD is being closed to do any necessary cleanup. */ 3296 b oolean(*_close_and_cleanup) PARAMS ((bfd *));4193 bfd_boolean (*_close_and_cleanup) PARAMS ((bfd *)); 3297 4194 /* Ask the BFD to free all cached information. */ 3298 b oolean (*_bfd_free_cached_info) PARAMS ((bfd *));4195 bfd_boolean (*_bfd_free_cached_info) PARAMS ((bfd *)); 3299 4196 /* Called when a new section is created. */ 3300 b oolean(*_new_section_hook) PARAMS ((bfd *, sec_ptr));4197 bfd_boolean (*_new_section_hook) PARAMS ((bfd *, sec_ptr)); 3301 4198 /* Read the contents of a section. */ 3302 boolean (*_bfd_get_section_contents) PARAMS ((bfd *, sec_ptr, PTR, 3303 file_ptr, bfd_size_type)); 3304 boolean (*_bfd_get_section_contents_in_window) 3305 PARAMS ((bfd *, sec_ptr, bfd_window *, 3306 file_ptr, bfd_size_type)); 4199 bfd_boolean (*_bfd_get_section_contents) 4200 PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type)); 4201 bfd_boolean (*_bfd_get_section_contents_in_window) 4202 PARAMS ((bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type)); 3307 4203 3308 4204 /* Entry points to copy private data. */ 3309 #define BFD_JUMP_TABLE_COPY(NAME) \3310 C AT(NAME,_bfd_copy_private_bfd_data),\3311 C AT(NAME,_bfd_merge_private_bfd_data),\3312 C AT(NAME,_bfd_copy_private_section_data),\3313 C AT(NAME,_bfd_copy_private_symbol_data),\3314 C AT(NAME,_bfd_set_private_flags),\3315 C AT(NAME,_bfd_print_private_bfd_data)\4205 #define BFD_JUMP_TABLE_COPY(NAME) \ 4206 CONCAT2 (NAME,_bfd_copy_private_bfd_data), \ 4207 CONCAT2 (NAME,_bfd_merge_private_bfd_data), \ 4208 CONCAT2 (NAME,_bfd_copy_private_section_data), \ 4209 CONCAT2 (NAME,_bfd_copy_private_symbol_data), \ 4210 CONCAT2 (NAME,_bfd_set_private_flags), \ 4211 CONCAT2 (NAME,_bfd_print_private_bfd_data) \ 3316 4212 /* Called to copy BFD general private data from one object file 3317 4213 to another. */ 3318 b oolean(*_bfd_copy_private_bfd_data) PARAMS ((bfd *, bfd *));4214 bfd_boolean (*_bfd_copy_private_bfd_data) PARAMS ((bfd *, bfd *)); 3319 4215 /* Called to merge BFD general private data from one object file 3320 4216 to a common output file when linking. */ 3321 b oolean(*_bfd_merge_private_bfd_data) PARAMS ((bfd *, bfd *));4217 bfd_boolean (*_bfd_merge_private_bfd_data) PARAMS ((bfd *, bfd *)); 3322 4218 /* Called to copy BFD private section data from one object file 3323 4219 to another. */ 3324 b oolean (*_bfd_copy_private_section_data) PARAMS ((bfd *, sec_ptr,3325 4220 bfd_boolean (*_bfd_copy_private_section_data) 4221 PARAMS ((bfd *, sec_ptr, bfd *, sec_ptr)); 3326 4222 /* Called to copy BFD private symbol data from one symbol 3327 4223 to another. */ 3328 b oolean (*_bfd_copy_private_symbol_data) PARAMS ((bfd *, asymbol *,3329 3330 /* Called to set private backend flags */3331 b oolean(*_bfd_set_private_flags) PARAMS ((bfd *, flagword));3332 3333 /* Called to print private BFD data */3334 b oolean(*_bfd_print_private_bfd_data) PARAMS ((bfd *, PTR));4224 bfd_boolean (*_bfd_copy_private_symbol_data) 4225 PARAMS ((bfd *, asymbol *, bfd *, asymbol *)); 4226 /* Called to set private backend flags. */ 4227 bfd_boolean (*_bfd_set_private_flags) PARAMS ((bfd *, flagword)); 4228 4229 /* Called to print private BFD data. */ 4230 bfd_boolean (*_bfd_print_private_bfd_data) PARAMS ((bfd *, PTR)); 3335 4231 3336 4232 /* Core file entry points. */ 3337 #define BFD_JUMP_TABLE_CORE(NAME) \3338 C AT(NAME,_core_file_failing_command),\3339 C AT(NAME,_core_file_failing_signal),\3340 C AT(NAME,_core_file_matches_executable_p)3341 char * (*_core_file_failing_command) PARAMS ((bfd *));3342 int (*_core_file_failing_signal) PARAMS ((bfd *));3343 b oolean(*_core_file_matches_executable_p) PARAMS ((bfd *, bfd *));4233 #define BFD_JUMP_TABLE_CORE(NAME) \ 4234 CONCAT2 (NAME,_core_file_failing_command), \ 4235 CONCAT2 (NAME,_core_file_failing_signal), \ 4236 CONCAT2 (NAME,_core_file_matches_executable_p) 4237 char * (*_core_file_failing_command) PARAMS ((bfd *)); 4238 int (*_core_file_failing_signal) PARAMS ((bfd *)); 4239 bfd_boolean (*_core_file_matches_executable_p) PARAMS ((bfd *, bfd *)); 3344 4240 3345 4241 /* Archive entry points. */ 3346 #define BFD_JUMP_TABLE_ARCHIVE(NAME)\ 3347 CAT(NAME,_slurp_armap),\ 3348 CAT(NAME,_slurp_extended_name_table),\ 3349 CAT(NAME,_construct_extended_name_table),\ 3350 CAT(NAME,_truncate_arname),\ 3351 CAT(NAME,_write_armap),\ 3352 CAT(NAME,_read_ar_hdr),\ 3353 CAT(NAME,_openr_next_archived_file),\ 3354 CAT(NAME,_get_elt_at_index),\ 3355 CAT(NAME,_generic_stat_arch_elt),\ 3356 CAT(NAME,_update_armap_timestamp) 3357 boolean (*_bfd_slurp_armap) PARAMS ((bfd *)); 3358 boolean (*_bfd_slurp_extended_name_table) PARAMS ((bfd *)); 3359 boolean (*_bfd_construct_extended_name_table) 3360 PARAMS ((bfd *, char **, bfd_size_type *, const char **)); 3361 void (*_bfd_truncate_arname) PARAMS ((bfd *, CONST char *, char *)); 3362 boolean (*write_armap) PARAMS ((bfd *arch, 3363 unsigned int elength, 3364 struct orl *map, 3365 unsigned int orl_count, 3366 int stridx)); 3367 PTR (*_bfd_read_ar_hdr_fn) PARAMS ((bfd *)); 3368 bfd * (*openr_next_archived_file) PARAMS ((bfd *arch, bfd *prev)); 4242 #define BFD_JUMP_TABLE_ARCHIVE(NAME) \ 4243 CONCAT2 (NAME,_slurp_armap), \ 4244 CONCAT2 (NAME,_slurp_extended_name_table), \ 4245 CONCAT2 (NAME,_construct_extended_name_table), \ 4246 CONCAT2 (NAME,_truncate_arname), \ 4247 CONCAT2 (NAME,_write_armap), \ 4248 CONCAT2 (NAME,_read_ar_hdr), \ 4249 CONCAT2 (NAME,_openr_next_archived_file), \ 4250 CONCAT2 (NAME,_get_elt_at_index), \ 4251 CONCAT2 (NAME,_generic_stat_arch_elt), \ 4252 CONCAT2 (NAME,_update_armap_timestamp) 4253 bfd_boolean (*_bfd_slurp_armap) PARAMS ((bfd *)); 4254 bfd_boolean (*_bfd_slurp_extended_name_table) PARAMS ((bfd *)); 4255 bfd_boolean (*_bfd_construct_extended_name_table) 4256 PARAMS ((bfd *, char **, bfd_size_type *, const char **)); 4257 void (*_bfd_truncate_arname) PARAMS ((bfd *, const char *, char *)); 4258 bfd_boolean (*write_armap) 4259 PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int)); 4260 PTR (*_bfd_read_ar_hdr_fn) PARAMS ((bfd *)); 4261 bfd * (*openr_next_archived_file) PARAMS ((bfd *, bfd *)); 3369 4262 #define bfd_get_elt_at_index(b,i) BFD_SEND(b, _bfd_get_elt_at_index, (b,i)) 3370 bfd * (*_bfd_get_elt_at_index) PARAMS ((bfd *, symindex));3371 int (*_bfd_stat_arch_elt) PARAMS ((bfd *, struct stat *));3372 b oolean(*_bfd_update_armap_timestamp) PARAMS ((bfd *));4263 bfd * (*_bfd_get_elt_at_index) PARAMS ((bfd *, symindex)); 4264 int (*_bfd_stat_arch_elt) PARAMS ((bfd *, struct stat *)); 4265 bfd_boolean (*_bfd_update_armap_timestamp) PARAMS ((bfd *)); 3373 4266 3374 4267 /* Entry points used for symbols. */ 3375 #define BFD_JUMP_TABLE_SYMBOLS(NAME)\ 3376 CAT(NAME,_get_symtab_upper_bound),\ 3377 CAT(NAME,_get_symtab),\ 3378 CAT(NAME,_make_empty_symbol),\ 3379 CAT(NAME,_print_symbol),\ 3380 CAT(NAME,_get_symbol_info),\ 3381 CAT(NAME,_bfd_is_local_label_name),\ 3382 CAT(NAME,_get_lineno),\ 3383 CAT(NAME,_find_nearest_line),\ 3384 CAT(NAME,_bfd_make_debug_symbol),\ 3385 CAT(NAME,_read_minisymbols),\ 3386 CAT(NAME,_minisymbol_to_symbol) 3387 long (*_bfd_get_symtab_upper_bound) PARAMS ((bfd *)); 3388 long (*_bfd_canonicalize_symtab) PARAMS ((bfd *, 3389 struct symbol_cache_entry **)); 3390 struct symbol_cache_entry * 3391 (*_bfd_make_empty_symbol) PARAMS ((bfd *)); 3392 void (*_bfd_print_symbol) PARAMS ((bfd *, PTR, 3393 struct symbol_cache_entry *, 3394 bfd_print_symbol_type)); 4268 #define BFD_JUMP_TABLE_SYMBOLS(NAME) \ 4269 CONCAT2 (NAME,_get_symtab_upper_bound), \ 4270 CONCAT2 (NAME,_get_symtab), \ 4271 CONCAT2 (NAME,_make_empty_symbol), \ 4272 CONCAT2 (NAME,_print_symbol), \ 4273 CONCAT2 (NAME,_get_symbol_info), \ 4274 CONCAT2 (NAME,_bfd_is_local_label_name), \ 4275 CONCAT2 (NAME,_get_lineno), \ 4276 CONCAT2 (NAME,_find_nearest_line), \ 4277 CONCAT2 (NAME,_bfd_make_debug_symbol), \ 4278 CONCAT2 (NAME,_read_minisymbols), \ 4279 CONCAT2 (NAME,_minisymbol_to_symbol) 4280 long (*_bfd_get_symtab_upper_bound) PARAMS ((bfd *)); 4281 long (*_bfd_canonicalize_symtab) PARAMS ((bfd *, 4282 struct symbol_cache_entry **)); 4283 struct symbol_cache_entry * 4284 (*_bfd_make_empty_symbol) PARAMS ((bfd *)); 4285 void (*_bfd_print_symbol) 4286 PARAMS ((bfd *, PTR, struct symbol_cache_entry *, bfd_print_symbol_type)); 3395 4287 #define bfd_print_symbol(b,p,s,e) BFD_SEND(b, _bfd_print_symbol, (b,p,s,e)) 3396 void (*_bfd_get_symbol_info) PARAMS ((bfd *, 3397 struct symbol_cache_entry *, 3398 symbol_info *)); 4288 void (*_bfd_get_symbol_info) 4289 PARAMS ((bfd *, struct symbol_cache_entry *, symbol_info *)); 3399 4290 #define bfd_get_symbol_info(b,p,e) BFD_SEND(b, _bfd_get_symbol_info, (b,p,e)) 3400 boolean (*_bfd_is_local_label_name) PARAMS ((bfd *, const char *)); 3401 3402 alent * (*_get_lineno) PARAMS ((bfd *, struct symbol_cache_entry *)); 3403 boolean (*_bfd_find_nearest_line) PARAMS ((bfd *abfd, 3404 struct sec *section, struct symbol_cache_entry **symbols, 3405 bfd_vma offset, CONST char **file, CONST char **func, 3406 unsigned int *line)); 4291 bfd_boolean (*_bfd_is_local_label_name) PARAMS ((bfd *, const char *)); 4292 4293 alent * (*_get_lineno) PARAMS ((bfd *, struct symbol_cache_entry *)); 4294 bfd_boolean (*_bfd_find_nearest_line) 4295 PARAMS ((bfd *, struct sec *, struct symbol_cache_entry **, bfd_vma, 4296 const char **, const char **, unsigned int *)); 3407 4297 /* Back-door to allow format-aware applications to create debug symbols 3408 4298 while using BFD for everything else. Currently used by the assembler 3409 4299 when creating COFF files. */ 3410 asymbol * (*_bfd_make_debug_symbol) PARAMS (( 3411 bfd *abfd, 3412 void *ptr, 3413 unsigned long size)); 4300 asymbol * (*_bfd_make_debug_symbol) 4301 PARAMS ((bfd *, void *, unsigned long size)); 3414 4302 #define bfd_read_minisymbols(b, d, m, s) \ 3415 4303 BFD_SEND (b, _read_minisymbols, (b, d, m, s)) 3416 long (*_read_minisymbols) PARAMS ((bfd *, boolean, PTR *,3417 4304 long (*_read_minisymbols) 4305 PARAMS ((bfd *, bfd_boolean, PTR *, unsigned int *)); 3418 4306 #define bfd_minisymbol_to_symbol(b, d, m, f) \ 3419 4307 BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) 3420 asymbol * (*_minisymbol_to_symbol) PARAMS ((bfd *, boolean, const PTR,3421 4308 asymbol * (*_minisymbol_to_symbol) 4309 PARAMS ((bfd *, bfd_boolean, const PTR, asymbol *)); 3422 4310 3423 4311 /* Routines for relocs. */ 3424 #define BFD_JUMP_TABLE_RELOCS(NAME) \3425 C AT(NAME,_get_reloc_upper_bound),\3426 C AT(NAME,_canonicalize_reloc),\3427 C AT(NAME,_bfd_reloc_type_lookup)3428 long (*_get_reloc_upper_bound) PARAMS ((bfd *, sec_ptr));3429 long (*_bfd_canonicalize_reloc) PARAMS ((bfd *, sec_ptr, arelent **,3430 4312 #define BFD_JUMP_TABLE_RELOCS(NAME) \ 4313 CONCAT2 (NAME,_get_reloc_upper_bound), \ 4314 CONCAT2 (NAME,_canonicalize_reloc), \ 4315 CONCAT2 (NAME,_bfd_reloc_type_lookup) 4316 long (*_get_reloc_upper_bound) PARAMS ((bfd *, sec_ptr)); 4317 long (*_bfd_canonicalize_reloc) 4318 PARAMS ((bfd *, sec_ptr, arelent **, struct symbol_cache_entry **)); 3431 4319 /* See documentation on reloc types. */ 3432 4320 reloc_howto_type * 3433 (*reloc_type_lookup) PARAMS ((bfd *abfd, 3434 bfd_reloc_code_real_type code)); 4321 (*reloc_type_lookup) PARAMS ((bfd *, bfd_reloc_code_real_type)); 3435 4322 3436 4323 /* Routines used when writing an object file. */ 3437 #define BFD_JUMP_TABLE_WRITE(NAME) \3438 C AT(NAME,_set_arch_mach),\3439 C AT(NAME,_set_section_contents)3440 b oolean (*_bfd_set_arch_mach) PARAMS ((bfd *, enum bfd_architecture,3441 3442 b oolean (*_bfd_set_section_contents) PARAMS ((bfd *, sec_ptr, PTR,3443 4324 #define BFD_JUMP_TABLE_WRITE(NAME) \ 4325 CONCAT2 (NAME,_set_arch_mach), \ 4326 CONCAT2 (NAME,_set_section_contents) 4327 bfd_boolean (*_bfd_set_arch_mach) 4328 PARAMS ((bfd *, enum bfd_architecture, unsigned long)); 4329 bfd_boolean (*_bfd_set_section_contents) 4330 PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type)); 3444 4331 3445 4332 /* Routines used by the linker. */ 3446 #define BFD_JUMP_TABLE_LINK(NAME)\ 3447 CAT(NAME,_sizeof_headers),\ 3448 CAT(NAME,_bfd_get_relocated_section_contents),\ 3449 CAT(NAME,_bfd_relax_section),\ 3450 CAT(NAME,_bfd_link_hash_table_create),\ 3451 CAT(NAME,_bfd_link_add_symbols),\ 3452 CAT(NAME,_bfd_final_link),\ 3453 CAT(NAME,_bfd_link_split_section),\ 3454 CAT(NAME,_bfd_gc_sections) 3455 int (*_bfd_sizeof_headers) PARAMS ((bfd *, boolean)); 3456 bfd_byte * (*_bfd_get_relocated_section_contents) PARAMS ((bfd *, 3457 struct bfd_link_info *, struct bfd_link_order *, 3458 bfd_byte *data, boolean relocateable, 3459 struct symbol_cache_entry **)); 3460 3461 boolean (*_bfd_relax_section) PARAMS ((bfd *, struct sec *, 3462 struct bfd_link_info *, boolean *again)); 4333 #define BFD_JUMP_TABLE_LINK(NAME) \ 4334 CONCAT2 (NAME,_sizeof_headers), \ 4335 CONCAT2 (NAME,_bfd_get_relocated_section_contents), \ 4336 CONCAT2 (NAME,_bfd_relax_section), \ 4337 CONCAT2 (NAME,_bfd_link_hash_table_create), \ 4338 CONCAT2 (NAME,_bfd_link_hash_table_free), \ 4339 CONCAT2 (NAME,_bfd_link_add_symbols), \ 4340 CONCAT2 (NAME,_bfd_link_just_syms), \ 4341 CONCAT2 (NAME,_bfd_final_link), \ 4342 CONCAT2 (NAME,_bfd_link_split_section), \ 4343 CONCAT2 (NAME,_bfd_gc_sections), \ 4344 CONCAT2 (NAME,_bfd_merge_sections), \ 4345 CONCAT2 (NAME,_bfd_discard_group) 4346 int (*_bfd_sizeof_headers) PARAMS ((bfd *, bfd_boolean)); 4347 bfd_byte * (*_bfd_get_relocated_section_contents) 4348 PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, 4349 bfd_byte *, bfd_boolean, struct symbol_cache_entry **)); 4350 4351 bfd_boolean (*_bfd_relax_section) 4352 PARAMS ((bfd *, struct sec *, struct bfd_link_info *, bfd_boolean *)); 3463 4353 3464 4354 /* Create a hash table for the linker. Different backends store 3465 4355 different information in this table. */ 3466 struct bfd_link_hash_table *(*_bfd_link_hash_table_create) PARAMS ((bfd *)); 4356 struct bfd_link_hash_table * 4357 (*_bfd_link_hash_table_create) PARAMS ((bfd *)); 4358 4359 /* Release the memory associated with the linker hash table. */ 4360 void (*_bfd_link_hash_table_free) 4361 PARAMS ((struct bfd_link_hash_table *)); 3467 4362 3468 4363 /* Add symbols from this object file into the hash table. */ 3469 boolean (*_bfd_link_add_symbols) PARAMS ((bfd *, struct bfd_link_info *)); 4364 bfd_boolean (*_bfd_link_add_symbols) 4365 PARAMS ((bfd *, struct bfd_link_info *)); 4366 4367 /* Indicate that we are only retrieving symbol values from this section. */ 4368 void (*_bfd_link_just_syms) 4369 PARAMS ((asection *, struct bfd_link_info *)); 3470 4370 3471 4371 /* Do a link based on the link_order structures attached to each 3472 4372 section of the BFD. */ 3473 b oolean (*_bfd_final_link) PARAMS ((bfd *, struct bfd_link_info *));4373 bfd_boolean (*_bfd_final_link) PARAMS ((bfd *, struct bfd_link_info *)); 3474 4374 3475 4375 /* Should this section be split up into smaller pieces during linking. */ 3476 b oolean (*_bfd_link_split_section) PARAMS ((bfd *, struct sec *));4376 bfd_boolean (*_bfd_link_split_section) PARAMS ((bfd *, struct sec *)); 3477 4377 3478 4378 /* Remove sections that are not referenced from the output. */ 3479 boolean (*_bfd_gc_sections) PARAMS ((bfd *, struct bfd_link_info *)); 4379 bfd_boolean (*_bfd_gc_sections) PARAMS ((bfd *, struct bfd_link_info *)); 4380 4381 /* Attempt to merge SEC_MERGE sections. */ 4382 bfd_boolean (*_bfd_merge_sections) PARAMS ((bfd *, struct bfd_link_info *)); 4383 4384 /* Discard members of a group. */ 4385 bfd_boolean (*_bfd_discard_group) PARAMS ((bfd *, struct sec *)); 3480 4386 3481 4387 /* Routines to handle dynamic symbols and relocs. */ 3482 #define BFD_JUMP_TABLE_DYNAMIC(NAME) \3483 C AT(NAME,_get_dynamic_symtab_upper_bound),\3484 C AT(NAME,_canonicalize_dynamic_symtab),\3485 C AT(NAME,_get_dynamic_reloc_upper_bound),\3486 C AT(NAME,_canonicalize_dynamic_reloc)3487 /* Get the amount of memory required to hold the dynamic symbols. */3488 long (*_bfd_get_dynamic_symtab_upper_bound) PARAMS ((bfd *));4388 #define BFD_JUMP_TABLE_DYNAMIC(NAME) \ 4389 CONCAT2 (NAME,_get_dynamic_symtab_upper_bound), \ 4390 CONCAT2 (NAME,_canonicalize_dynamic_symtab), \ 4391 CONCAT2 (NAME,_get_dynamic_reloc_upper_bound), \ 4392 CONCAT2 (NAME,_canonicalize_dynamic_reloc) 4393 /* Get the amount of memory required to hold the dynamic symbols. */ 4394 long (*_bfd_get_dynamic_symtab_upper_bound) PARAMS ((bfd *)); 3489 4395 /* Read in the dynamic symbols. */ 3490 long (*_bfd_canonicalize_dynamic_symtab)4396 long (*_bfd_canonicalize_dynamic_symtab) 3491 4397 PARAMS ((bfd *, struct symbol_cache_entry **)); 3492 4398 /* Get the amount of memory required to hold the dynamic relocs. */ 3493 long (*_bfd_get_dynamic_reloc_upper_bound) PARAMS ((bfd *));4399 long (*_bfd_get_dynamic_reloc_upper_bound) PARAMS ((bfd *)); 3494 4400 /* Read in the dynamic relocs. */ 3495 long (*_bfd_canonicalize_dynamic_reloc)4401 long (*_bfd_canonicalize_dynamic_reloc) 3496 4402 PARAMS ((bfd *, arelent **, struct symbol_cache_entry **)); 3497 4403 3498 /* Opposite endian version of this target. */ 3499 const struct bfd_target * alternative_target; 3500 3501 PTR backend_data; 4404 /* Opposite endian version of this target. */ 4405 const struct bfd_target * alternative_target; 4406 4407 /* Data for use by back-end routines, which isn't 4408 generic enough to belong in this structure. */ 4409 PTR backend_data; 3502 4410 3503 4411 } bfd_target; 3504 boolean 4412 4413 bfd_boolean 3505 4414 bfd_set_default_target PARAMS ((const char *name)); 3506 4415 3507 4416 const bfd_target * 3508 bfd_find_target PARAMS (( CONSTchar *target_name, bfd *abfd));4417 bfd_find_target PARAMS ((const char *target_name, bfd *abfd)); 3509 4418 3510 4419 const char ** … … 3512 4421 3513 4422 const bfd_target * 3514 bfd_search_for_target PARAMS ((int (* search_func) (const bfd_target *, void *), void *)); 3515 3516 boolean 4423 bfd_search_for_target PARAMS ((int (* search_func) 4424 (const bfd_target *, void *), 4425 void *)); 4426 4427 /* Extracted from format.c. */ 4428 bfd_boolean 3517 4429 bfd_check_format PARAMS ((bfd *abfd, bfd_format format)); 3518 4430 3519 boolean 3520 bfd_check_format_matches PARAMS ((bfd *abfd, bfd_format format, char ***matching)); 3521 3522 boolean 4431 bfd_boolean 4432 bfd_check_format_matches PARAMS ((bfd *abfd, bfd_format format, 4433 char ***matching)); 4434 4435 bfd_boolean 3523 4436 bfd_set_format PARAMS ((bfd *abfd, bfd_format format)); 3524 4437 3525 CONSTchar *4438 const char * 3526 4439 bfd_format_string PARAMS ((bfd_format format)); 4440 4441 /* Extracted from linker.c. */ 4442 bfd_boolean 4443 bfd_link_split_section PARAMS ((bfd *abfd, asection *sec)); 4444 4445 #define bfd_link_split_section(abfd, sec) \ 4446 BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec)) 4447 4448 /* Extracted from simple.c. */ 4449 bfd_byte * 4450 bfd_simple_get_relocated_section_contents PARAMS ((bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table)); 3527 4451 3528 4452 #ifdef __cplusplus -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/binutils/bfd/config.bfd
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r617 r618 6 6 # targ_defvec Default vector for this target 7 7 # targ_selvecs Vectors to build for this target 8 # targ64_selvecs Vectors to build if --enable-64-bit-bfd is given 9 # or if host is 64 bit. 8 10 # targ_archs Architectures for this target 9 11 # targ_cflags $(CFLAGS) for this target (FIXME: pretty bogus) … … 24 26 targ_defvec= 25 27 targ_selvecs= 28 targ64_selvecs= 26 29 targ_cflags= 27 30 targ_underscore=no … … 29 32 targ_cpu=`echo $targ | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` 30 33 case "${targ_cpu}" in 31 alpha*) targ_archs=bfd_alpha_arch ;; 32 arm*) targ_archs=bfd_arm_arch ;; 33 strongarm*) targ_archs=bfd_arm_arch ;; 34 thumb*) targ_archs=bfd_arm_arch ;; 35 xscale*) targ_archs=bfd_arm_arch ;; 36 c30*) targ_archs=bfd_tic30_arch ;; 37 c54x*) targ_archs=bfd_tic54x_arch ;; 38 hppa*) targ_archs=bfd_hppa_arch ;; 39 x86_64) targ_archs=bfd_i386_arch ;; 40 i[3456]86) targ_archs=bfd_i386_arch ;; 41 i370) targ_archs=bfd_i370_arch ;; 34 alpha*) targ_archs=bfd_alpha_arch ;; 35 arm*) targ_archs=bfd_arm_arch ;; 36 c30*) targ_archs=bfd_tic30_arch ;; 37 c4x*) targ_archs=bfd_tic4x_arch ;; 38 c54x*) targ_archs=bfd_tic54x_arch ;; 39 dlx*) targ_archs=bfd_dlx_arch ;; 40 hppa*) targ_archs=bfd_hppa_arch ;; 41 i[3456]86) targ_archs=bfd_i386_arch ;; 42 i370) targ_archs=bfd_i370_arch ;; 42 43 m6811*|m68hc11*) targ_archs="bfd_m68hc11_arch bfd_m68hc12_arch" ;; 43 44 m6812*|m68hc12*) targ_archs="bfd_m68hc12_arch bfd_m68hc11_arch" ;; 44 m68*) targ_archs=bfd_m68k_arch ;; 45 m88*) targ_archs=bfd_m88k_arch ;; 46 mips*) targ_archs=bfd_mips_arch ;; 47 pj*) targ_archs="bfd_pj_arch bfd_i386_arch";; 48 powerpc*) targ_archs="bfd_rs6000_arch bfd_powerpc_arch" ;; 49 rs6000) targ_archs="bfd_rs6000_arch bfd_powerpc_arch" ;; 50 sparc*) targ_archs=bfd_sparc_arch ;; 51 v850*) targ_archs=bfd_v850_arch ;; 52 z8k*) targ_archs=bfd_z8k_arch ;; 53 *) targ_archs=bfd_${targ_cpu}_arch ;; 45 m68*) targ_archs=bfd_m68k_arch ;; 46 m88*) targ_archs=bfd_m88k_arch ;; 47 mips*) targ_archs=bfd_mips_arch ;; 48 or32*) targ_archs=bfd_or32_arch ;; 49 pdp11*) targ_archs=bfd_pdp11_arch ;; 50 pj*) targ_archs="bfd_pj_arch bfd_i386_arch";; 51 powerpc*) targ_archs="bfd_rs6000_arch bfd_powerpc_arch" ;; 52 rs6000) targ_archs="bfd_rs6000_arch bfd_powerpc_arch" ;; 53 s390*) targ_archs=bfd_s390_arch ;; 54 sh*) targ_archs=bfd_sh_arch ;; 55 sparc*) targ_archs=bfd_sparc_arch ;; 56 strongarm*) targ_archs=bfd_arm_arch ;; 57 thumb*) targ_archs=bfd_arm_arch ;; 58 v850*) targ_archs=bfd_v850_arch ;; 59 x86_64) targ_archs=bfd_i386_arch ;; 60 xscale*) targ_archs=bfd_arm_arch ;; 61 xtensa*) targ_archs=bfd_xtensa_arch ;; 62 z8k*) targ_archs=bfd_z8k_arch ;; 63 *) targ_archs=bfd_${targ_cpu}_arch ;; 54 64 esac 55 65 … … 59 69 # can get spurious matches. Even for unambiguous cases, do this as a 60 70 # convention, else the table becomes a real mess to understand and maintain. 71 # 72 # Keep obsolete entries above the START comment, to keep them out of 73 # targmatch.h. 61 74 62 75 case "${targ}" in 76 mips*-dec-bsd*) 77 echo "This target is obsolete and has been removed." 78 exit 1 79 ;; 80 81 mips*-*-pe*) 82 echo "This target is obsolete and has been removed." 83 exit 1 84 ;; 85 63 86 # START OF targmatch.h 64 87 #ifdef BFD64 65 alpha*-*-netbsd* | alpha*-*-freebsd*) 88 alpha*-*-freebsd*) 89 targ_defvec=bfd_elf64_alpha_freebsd_vec 90 targ_selvecs=ecoffalpha_little_vec 91 # FreeBSD <= 4.0 supports only the old nonstandard way of ABI labelling. 92 case "${targ}" in 93 alpha*-*-freebsd3* | alpha*-*-freebsd4 | alpha*-*-freebsd4.0*) 94 targ_cflags=-DOLD_FREEBSD_ABI_LABEL ;; 95 esac 96 ;; 97 alpha*-*-netbsd* | alpha*-*-openbsd*) 66 98 targ_defvec=bfd_elf64_alpha_vec 67 99 targ_selvecs=ecoffalpha_little_vec … … 85 117 targ_defvec=ecoffalpha_little_vec 86 118 ;; 87 ia64*-*-freebsd* | ia64*-*-linux-gnu* | ia64*-*-elf*) 119 ia64*-*-aix*) 120 targ_defvec=bfd_elf64_ia64_aix_little_vec 121 targ_selvecs="bfd_elf64_ia64_aix_big_vec bfd_efi_app_ia64_vec" 122 ;; 123 ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf*) 88 124 targ_defvec=bfd_elf64_ia64_little_vec 89 125 targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec" 90 126 ;; 91 127 ia64*-*-hpux*) 92 targ_defvec=bfd_elf 64_ia64_big_vec93 targ_selvecs="bfd_elf 32_ia64_big_vec"94 ;; 95 sparc64-*-freebsd* | sparc64-*-netbsd* )128 targ_defvec=bfd_elf32_ia64_hpux_big_vec 129 targ_selvecs="bfd_elf64_ia64_hpux_big_vec" 130 ;; 131 sparc64-*-freebsd* | sparc64-*-netbsd* | sparc64-*-openbsd*) 96 132 targ_defvec=bfd_elf64_sparc_vec 97 133 targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec" … … 104 140 ;; 105 141 106 arm-*-netbsd*) 142 armeb-*-netbsdelf*) 143 targ_defvec=bfd_elf32_bigarm_vec 144 targ_selvecs="bfd_elf32_littlearm_vec armnetbsd_vec" 145 ;; 146 arm-*-netbsdelf*) 147 targ_defvec=bfd_elf32_littlearm_vec 148 targ_selvecs="bfd_elf32_bigarm_vec armnetbsd_vec" 149 ;; 150 arm-*-netbsd* | arm-*-openbsd*) 107 151 targ_defvec=armnetbsd_vec 108 targ_underscore=yes 152 targ_selvecs="bfd_elf32_littlearm_vec bfd_elf32_bigarm_vec" 153 targ_underscore=yes 154 ;; 155 arm-*-nto* | nto*arm*) 156 targ_defvec=bfd_elf32_littlearm_vec 157 targ_selvecs=bfd_elf32_bigarm_vec 109 158 ;; 110 159 arm-*-riscix*) … … 115 164 targ_selvecs="arm_epoc_pe_little_vec arm_epoc_pe_big_vec arm_epoc_pei_little_vec arm_epoc_pei_big_vec" 116 165 targ_underscore=no 166 targ_cflags=-DARM_COFF_BUGFIX 117 167 ;; 118 168 arm-wince-pe | arm-*-wince) … … 135 185 targ_selvecs=aout_arm_little_vec 136 186 ;; 187 arm-*-vxworks*) 188 targ_defvec=armcoff_little_vec 189 targ_selvecs=armcoff_big_vec 190 targ_underscore=yes 191 targ_cflags=-DARM_COFF_BUGFIX 192 ;; 137 193 arm-*-coff) 138 194 targ_defvec=armcoff_little_vec … … 140 196 targ_underscore=yes 141 197 ;; 142 arm-*-vxworks*)143 targ_defvec=armcoff_little_vec144 targ_selvecs=armcoff_big_vec145 targ_underscore=yes146 targ_cflags=-DVXWORKS147 ;;148 198 arm-*-rtems*) 149 199 targ_defvec=bfd_elf32_littlearm_vec … … 154 204 targ_selvecs=bfd_elf32_littlearm_vec 155 205 ;; 206 arm-*-kaos* | strongarm-*-kaos*) 207 targ_defvec=bfd_elf32_littlearm_vec 208 targ_selvecs=bfd_elf32_bigarm_vec 209 ;; 156 210 arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | arm*-*-uclinux*) 211 targ_defvec=bfd_elf32_littlearm_vec 212 targ_selvecs=bfd_elf32_bigarm_vec 213 ;; 214 arm9e-*-elf) 157 215 targ_defvec=bfd_elf32_littlearm_vec 158 216 targ_selvecs=bfd_elf32_bigarm_vec … … 227 285 ;; 228 286 287 c4x-*-*coff* | tic4x-*-*coff*) 288 targ_defvec=tic4x_coff1_vec 289 targ_selvecs="tic4x_coff1_beh_vec tic4x_coff2_vec tic4x_coff2_beh_vec tic4x_coff0_vec tic4x_coff0_beh_vec" 290 targ_underscore=yes 291 ;; 292 229 293 c54x*-*-*coff* | tic54x-*-*coff*) 230 294 targ_defvec=tic54x_coff1_vec … … 243 307 ;; 244 308 309 dlx-*-elf*) 310 targ_defvec=bfd_elf32_dlx_big_vec 311 targ_selvecs="bfd_elf32_dlx_big_vec" 312 ;; 313 245 314 d30v-*-*) 246 315 targ_defvec=bfd_elf32_d30v_vec … … 251 320 ;; 252 321 322 frv-*-elf) 323 targ_defvec=bfd_elf32_frv_vec 324 ;; 325 326 327 h8300*-*-elf) 328 targ_defvec=bfd_elf32_h8300_vec 329 targ_underscore=yes 330 ;; 253 331 254 332 h8300*-*-*) … … 278 356 targ_selvecs=bfd_elf32_hppa_vec 279 357 ;; 280 hppa*-*-*elf* | hppa*-*-lites* | hppa*-*- sysv4* | hppa*-*-rtems*)358 hppa*-*-*elf* | hppa*-*-lites* | hppa*-*-netbsd* | hppa*-*-sysv4* | hppa*-*-rtems* | hppa*-*-openbsd*) 281 359 targ_defvec=bfd_elf32_hppa_vec 282 360 targ_selvecs=bfd_elf32_hppa_linux_vec … … 311 389 targ_selvecs=i386coff_vec 312 390 ;; 313 i[3456]86-*- rtemself*)391 i[3456]86-*-kaos*) 314 392 targ_defvec=bfd_elf32_i386_vec 315 targ_selvecs="i386coff_vec i386aout_vec" 393 targ_selvecs=bfd_elf32_i386_vec 394 ;; 395 i[3456]86-*-nto*) 396 targ_defvec=bfd_elf32_i386_vec 397 targ_selvecs=i386coff_vec 398 ;; 399 i[3456]86-*-aros*) 400 targ_defvec=bfd_elf32_i386_vec 316 401 ;; 317 402 i[3456]86-*-chorus*) 318 403 targ_defvec=bfd_elf32_i386_vec 319 404 ;; 320 i[3456]86-*-msdosdjgpp* | i[3456]*-*-go32* | i[3456]86-go32-rtems* )405 *-*-msdosdjgpp* | *-*-go32* | *-go32-rtems* ) 321 406 targ_defvec=go32coff_vec 322 407 targ_selvecs="go32stubbedcoff_vec i386aout_vec" … … 326 411 targ_defvec=i386coff_vec 327 412 ;; 328 i[3456]86*-*-rtems *)413 i[3456]86*-*-rtemscoff*) 329 414 targ_defvec=i386coff_vec 330 415 targ_selvecs="bfd_elf32_i386_vec i386aout_vec" 416 ;; 417 i[3456]86-*-rtemself* | i[3456]86-*-rtems*) 418 targ_defvec=bfd_elf32_i386_vec 419 targ_selvecs="i386coff_vec i386aout_vec" 420 ;; 421 i[3456]86-*-darwin* | i[3456]86-*-macos10* | i[3456]86-*-rhapsody*) 422 targ_defvec=mach_o_le_vec 423 targ_selvecs="mach_o_le_vec mach_o_be_vec mach_o_fat_vec pef_vec pef_xlib_vec sym_vec" 424 targ_archs="bfd_i386_arch bfd_powerpc_arch bfd_rs6000_arch" 331 425 ;; 332 426 i[3456]86-sequent-bsd*) … … 345 439 ;; 346 440 i[3456]86-*-freebsd*) 347 targ_defvec=bfd_elf32_i386_ vec441 targ_defvec=bfd_elf32_i386_freebsd_vec 348 442 targ_selvecs=i386coff_vec 443 # FreeBSD <= 4.0 supports only the old nonstandard way of ABI labelling. 444 case "${targ}" in 445 i[3456]86-*-freebsd3* | i[3456]86-*-freebsd4 | i[3456]86-*-freebsd4.0*) 446 targ_cflags=-DOLD_FREEBSD_ABI_LABEL ;; 447 esac 349 448 ;; 350 449 i[3456]86-*-netbsdelf*) … … 352 451 targ_selvecs=i386netbsd_vec 353 452 ;; 453 i[3456]86-*-netbsdpe*) 454 targ_defvec=i386pe_vec 455 targ_selvecs="i386pe_vec i386pei_vec bfd_elf32_i386_vec" 456 ;; 354 457 i[3456]86-*-netbsdaout* | i[3456]86-*-netbsd* | i[3456]86-*-openbsd*) 355 458 targ_defvec=i386netbsd_vec … … 369 472 targ_defvec=bfd_elf32_i386_vec 370 473 targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec" 371 ;; 372 #ifdef BFD64 474 targ64_selvecs=bfd_elf64_x86_64_vec 475 ;; 476 #ifdef BFD64 373 477 x86_64-*-freebsd*) 374 478 targ_defvec=bfd_elf64_x86_64_vec 375 479 targ_selvecs="bfd_elf32_i386_vec i386coff_vec bfd_efi_app_ia32_vec" 480 ;; 481 x86_64-*-netbsd*) 482 targ_defvec=bfd_elf64_x86_64_vec 483 targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec" 376 484 ;; 377 485 x86_64-*-linux-gnu*) … … 465 573 targ_defvec=bfd_elf32_i960_vec 466 574 targ_selvecs="icoff_little_vec icoff_big_vec" 575 ;; 576 577 ip2k-*-elf) 578 targ_defvec=bfd_elf32_ip2k_vec 579 ;; 580 581 iq2000-*-elf) 582 targ_defvec=bfd_elf32_iq2000_vec 467 583 ;; 468 584 … … 502 618 targ_underscore=yes 503 619 ;; 620 m68*-*-rtemscoff*) 621 targ_defvec=m68kcoff_vec 622 targ_selvecs="m68kcoff_vec versados_vec ieee_vec aout0_big_vec" 623 ;; 504 624 m68*-*-elf* | m68*-*-sysv4*) 505 625 targ_defvec=bfd_elf32_m68k_vec … … 507 627 ;; 508 628 m68*-*-rtems*) 509 targ_defvec= m68kcoff_vec629 targ_defvec=bfd_elf32_m68k_vec 510 630 targ_selvecs="m68kcoff_vec versados_vec ieee_vec aout0_big_vec" 511 631 ;; … … 541 661 targ_underscore=yes 542 662 ;; 543 m68*-*-netbsd* | m68*-*-openbsd*) 663 m68*-*-netbsdelf*) 664 targ_defvec=bfd_elf32_m68k_vec 665 targ_selvecs="m68knetbsd_vec m68k4knetbsd_vec hp300bsd_vec sunos_big_vec" 666 ;; 667 m68*-*-netbsdaout* | m68*-*-netbsd*) 668 targ_defvec=m68knetbsd_vec 669 targ_selvecs="m68k4knetbsd_vec bfd_elf32_m68k_vec hp300bsd_vec sunos_big_vec" 670 targ_underscore=yes 671 ;; 672 m68*-*-openbsd*) 544 673 targ_defvec=m68knetbsd_vec 545 674 targ_selvecs="m68k4knetbsd_vec hp300bsd_vec sunos_big_vec" … … 595 724 targ_selvecs=ecoff_little_vec 596 725 ;; 597 mips -dec-netbsd* | mips*el*-*-netbsd*)726 mips*el-*-netbsd*) 598 727 targ_defvec=bfd_elf32_littlemips_vec 599 targ_selvecs="bfd_elf32_bigmips_vec ecoff_little_vec ecoff_big_vec"600 ;; 601 mips*-*-netbsd*)728 targ_selvecs="bfd_elf32_bigmips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec ecoff_little_vec ecoff_big_vec" 729 ;; 730 mips*-*-netbsd*) 602 731 targ_defvec=bfd_elf32_bigmips_vec 603 targ_selvecs="bfd_elf32_littlemips_vec ecoff_big_vec ecoff_little_vec" 604 ;; 605 mips*-dec-bsd*) 606 targ_defvec=aout_mips_little_vec 607 targ_underscore=yes 732 targ_selvecs="bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec ecoff_big_vec ecoff_little_vec" 608 733 ;; 609 734 mips*-dec-mach3*) … … 619 744 targ_selvecs=ecoff_little_vec 620 745 ;; 746 #ifdef BFD64 621 747 mips*-*-irix6*) 622 targ_defvec=bfd_elf32_bigmips_vec 623 targ_selvecs="bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec" 624 ;; 748 targ_defvec=bfd_elf32_nbigmips_vec 749 targ_selvecs="bfd_elf32_nlittlemips_vec bfd_elf32_bigmips_vec bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec" 750 ;; 751 #endif 625 752 mips*-*-irix5*) 626 753 targ_defvec=bfd_elf32_bigmips_vec … … 639 766 targ_cflags=-DSTAT_FOR_EXEC 640 767 ;; 641 mips*-*-pe*)642 targ_defvec=mipslpe_vec643 targ_selvecs="mipslpei_vec mipslpei_vec ecoff_little_vec ecoff_big_vec"644 targ_underscore=yes645 ;;646 768 mips*-*-sysv4*) 647 769 targ_defvec=bfd_elf32_tradbigmips_vec … … 664 786 targ_selvecs="bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec" 665 787 ;; 666 mips*el *-*-openbsd*)788 mips*el-*-openbsd*) 667 789 targ_defvec=bfd_elf32_littlemips_vec 668 790 targ_selvecs="bfd_elf32_bigmips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec ecoff_little_vec ecoff_big_vec" 669 ;;670 mips*el*-*-linux-gnu*)671 targ_defvec=bfd_elf32_tradlittlemips_vec672 targ_selvecs="bfd_elf32_tradbigmips_vec bfd_elf64_tradlittlemips_vec bfd_elf64_tradbigmips_vec ecoff_little_vec ecoff_big_vec"673 791 ;; 674 792 mips*-*-openbsd*) … … 676 794 targ_selvecs="bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec ecoff_big_vec ecoff_little_vec" 677 795 ;; 678 mips*-*-linux-gnu*) 796 #ifdef BFD64 797 mips64*el-*-linux*) 798 targ_defvec=bfd_elf32_ntradlittlemips_vec 799 targ_selvecs="bfd_elf32_ntradbigmips_vec bfd_elf32_tradlittlemips_vec bfd_elf32_tradbigmips_vec bfd_elf64_tradlittlemips_vec bfd_elf64_tradbigmips_vec" 800 ;; 801 mips64*-*-linux*) 802 targ_defvec=bfd_elf32_ntradbigmips_vec 803 targ_selvecs="bfd_elf32_ntradlittlemips_vec bfd_elf32_tradbigmips_vec bfd_elf32_tradlittlemips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec" 804 ;; 805 #endif 806 mips*el-*-linux*) 807 targ_defvec=bfd_elf32_tradlittlemips_vec 808 targ_selvecs="bfd_elf32_tradbigmips_vec ecoff_little_vec ecoff_big_vec bfd_elf32_ntradlittlemips_vec bfd_elf64_tradlittlemips_vec bfd_elf32_ntradbigmips_vec bfd_elf64_tradbigmips_vec" 809 want64=true 810 ;; 811 mips*-*-linux*) 679 812 targ_defvec=bfd_elf32_tradbigmips_vec 680 targ_selvecs="bfd_elf32_tradlittlemips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec ecoff_big_vec ecoff_little_vec" 681 ;; 682 813 targ_selvecs="bfd_elf32_tradlittlemips_vec ecoff_big_vec ecoff_little_vec bfd_elf32_ntradbigmips_vec bfd_elf64_tradbigmips_vec bfd_elf32_ntradlittlemips_vec bfd_elf64_tradlittlemips_vec" 814 want64=true 815 ;; 816 #ifdef BFD64 817 mmix-*-*) 818 targ_defvec=bfd_elf64_mmix_vec 819 targ_selvecs=bfd_mmo_vec 820 ;; 821 #endif 683 822 mn10200-*-*) 684 823 targ_defvec=bfd_elf32_mn10200_vec … … 689 828 ;; 690 829 830 msp430-*-*) 831 targ_defvec=bfd_elf32_msp430_vec 832 ;; 833 691 834 ns32k-pc532-mach* | ns32k-pc532-ux*) 692 835 targ_defvec=pc532machaout_vec … … 695 838 ns32k-*-netbsd* | ns32k-*-lites* | ns32k-*-openbsd*) 696 839 targ_defvec=pc532netbsd_vec 840 targ_underscore=yes 841 ;; 842 843 openrisc-*-elf) 844 targ_defvec=bfd_elf32_openrisc_vec 845 ;; 846 847 or32-*-coff | or32-*-rtems*) 848 targ_defvec=or32coff_big_vec 849 targ_underscore=yes 850 ;; 851 852 or32-*-elf) 853 targ_defvec=bfd_elf32_or32_big_vec 854 ;; 855 856 pdp11-*-*) 857 targ_defvec=pdp11_aout_vec 697 858 targ_underscore=yes 698 859 ;; … … 708 869 ;; 709 870 710 powerpc-*-aix * | powerpc-*-beos*)871 powerpc-*-aix5*) 711 872 targ_defvec=rs6000coff_vec 712 targ_selvecs="rs6000coff64_vec" 713 ;; 873 targ_selvecs="aix5coff64_vec" 874 want64=true 875 ;; 876 #ifdef BFD64 877 powerpc64-*-aix5*) 878 targ_defvec=aix5coff64_vec 879 targ_selvecs="rs6000coff_vec" 880 want64=true 881 ;; 882 #endif 883 884 powerpc-*-aix* | powerpc-*-beos* | rs6000-*-*) 885 targ_defvec=rs6000coff_vec 886 targ64_selvecs=rs6000coff64_vec 887 case "${targ}" in 888 *-*-aix4.[3456789]* | *-*-aix[56789]*) 889 want64=true;; 890 891 *) 892 targ_cflags=-DSMALL_ARCHIVE;; 893 esac 894 ;; 895 #ifdef BFD64 896 powerpc64-*-aix*) 897 targ_defvec=rs6000coff64_vec 898 targ_selvecs=rs6000coff_vec 899 ;; 900 powerpc64-*-elf* | powerpc-*-elf64* | powerpc64-*-linux* | \ 901 powerpc64-*-*bsd*) 902 targ_defvec=bfd_elf64_powerpc_vec 903 targ_selvecs="bfd_elf64_powerpcle_vec bfd_elf32_powerpc_vec bfd_elf32_powerpcle_vec rs6000coff_vec rs6000coff64_vec" 904 ;; 905 powerpc64le-*-elf* | powerpcle-*-elf64*) 906 targ_defvec=bfd_elf64_powerpcle_vec 907 targ_selvecs="bfd_elf64_powerpc_vec bfd_elf32_powerpcle_vec bfd_elf32_powerpc_vec rs6000coff_vec rs6000coff64_vec" 908 ;; 909 #endif 714 910 powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \ 715 911 powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-rtems* | \ 716 powerpc-*-chorus* | powerpc-*-vxworks* )912 powerpc-*-chorus* | powerpc-*-vxworks* | powerpc-*-windiss*) 717 913 targ_defvec=bfd_elf32_powerpc_vec 718 914 targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec" 915 targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec" 916 ;; 917 powerpc-*-kaos*) 918 targ_defvec=bfd_elf32_powerpc_vec 919 targ_selvecs="bfd_elf32_powerpcle_vec ppcboot_vec" 920 targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec" 921 ;; 922 powerpc-*-darwin* | powerpc-*-macos10* | powerpc-*-rhapsody*) 923 targ_defvec=mach_o_be_vec 924 targ_selvecs="mach_o_be_vec mach_o_le_vec mach_o_fat_vec pef_vec pef_xlib_vec sym_vec" 925 targ_archs="bfd_powerpc_arch bfd_rs6000_arch bfd_i386_arch" 719 926 ;; 720 927 powerpc-*-macos* | powerpc-*-mpw*) … … 724 931 targ_defvec=bfd_elf32_powerpc_vec 725 932 targ_selvecs="nlm32_powerpc_vec rs6000coff_vec" 933 ;; 934 powerpc-*-nto*) 935 targ_defvec=bfd_elf32_powerpc_vec 936 targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec" 937 ;; 938 powerpcle-*-nto*) 939 targ_defvec=bfd_elf32_powerpcle_vec 940 targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec" 726 941 ;; 727 942 powerpcle-*-elf* | powerpcle-*-sysv4* | powerpcle-*-eabi* | \ … … 730 945 targ_defvec=bfd_elf32_powerpcle_vec 731 946 targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec" 947 targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec" 732 948 ;; 733 949 … … 737 953 ;; 738 954 739 rs6000-*-*) 740 targ_defvec=rs6000coff_vec 741 ;; 955 s390-*-linux*) 956 targ_defvec=bfd_elf32_s390_vec 957 targ64_selvecs=bfd_elf64_s390_vec 958 ;; 959 #ifdef BFD64 960 s390x-*-linux*) 961 targ_defvec=bfd_elf64_s390_vec 962 targ_selvecs=bfd_elf32_s390_vec 963 ;; 964 #endif 965 966 #ifdef BFD64 967 sh64l*-*-elf*) 968 targ_defvec=bfd_elf32_sh64l_vec 969 targ_selvecs="bfd_elf32_sh64_vec bfd_elf64_sh64l_vec bfd_elf64_sh64_vec bfd_elf32_shl_vec bfd_elf32_sh_vec" 970 targ_underscore=yes 971 ;; 972 sh64-*-elf*) 973 targ_defvec=bfd_elf32_sh64_vec 974 targ_selvecs="bfd_elf32_sh64l_vec bfd_elf64_sh64_vec bfd_elf64_sh64l_vec bfd_elf32_sh_vec bfd_elf32_shl_vec" 975 targ_underscore=yes 976 ;; 977 sh64eb-*-linux*) 978 targ_defvec=bfd_elf32_sh64blin_vec 979 targ_selvecs="bfd_elf32_sh64lin_vec bfd_elf64_sh64blin_vec bfd_elf64_sh64lin_vec bfd_elf32_shblin_vec bfd_elf32_shlin_vec" 980 ;; 981 sh64-*-linux*) 982 targ_defvec=bfd_elf32_sh64lin_vec 983 targ_selvecs="bfd_elf32_sh64blin_vec bfd_elf64_sh64lin_vec bfd_elf64_sh64blin_vec bfd_elf32_shlin_vec bfd_elf32_shblin_vec" 984 ;; 985 #endif /* BFD64 */ 742 986 743 987 sh-*-linux*) 744 988 targ_defvec=bfd_elf32_shblin_vec 745 989 targ_selvecs=bfd_elf32_shlin_vec 746 ;; 747 748 sh-*-elf* | sh-*-rtemself*) 990 #ifdef BFD64 991 targ_selvecs="${targ_selvecs} bfd_elf32_sh64lin_vec bfd_elf32_sh64blin_vec bfd_elf64_sh64lin_vec bfd_elf64_sh64blin_vec" 992 #endif 993 ;; 994 sh*eb-*-linux*) 995 targ_defvec=bfd_elf32_shblin_vec 996 targ_selvecs=bfd_elf32_shlin_vec 997 ;; 998 sh*-*-linux*) 999 targ_defvec=bfd_elf32_shlin_vec 1000 targ_selvecs=bfd_elf32_shblin_vec 1001 ;; 1002 1003 #ifdef BFD64 1004 sh5le-*-netbsd*) 1005 targ_defvec=bfd_elf32_sh64lnbsd_vec 1006 targ_selvecs="bfd_elf32_sh64nbsd_vec bfd_elf64_sh64lnbsd_vec bfd_elf64_sh64nbsd_vec" 1007 ;; 1008 sh5-*-netbsd*) 1009 targ_defvec=bfd_elf32_sh64nbsd_vec 1010 targ_selvecs="bfd_elf32_sh64lnbsd_vec bfd_elf64_sh64lnbsd_vec bfd_elf64_sh64nbsd_vec" 1011 ;; 1012 1013 sh64le-*-netbsd*) 1014 targ_defvec=bfd_elf64_sh64lnbsd_vec 1015 targ_selvecs="bfd_elf64_sh64nbsd_vec bfd_elf32_sh64lnbsd_vec bfd_elf32_sh64nbsd_vec" 1016 ;; 1017 sh64-*-netbsd*) 1018 targ_defvec=bfd_elf64_sh64nbsd_vec 1019 targ_selvecs="bfd_elf64_sh64lnbsd_vec bfd_elf32_sh64lnbsd_vec bfd_elf32_sh64nbsd_vec" 1020 ;; 1021 #endif 1022 1023 shle-*-netbsdelf*) 1024 targ_defvec=bfd_elf32_shlnbsd_vec 1025 targ_selvecs="bfd_elf32_shnbsd_vec shcoff_vec shlcoff_vec" 1026 #ifdef BFD64 1027 targ_selvecs="${targ_selvecs} bfd_elf32_sh64lnbsd_vec bfd_elf32_sh64nbsd_vec bfd_elf64_sh64lnbsd_vec bfd_elf64_sh64nbsd_vec" 1028 #endif 1029 ;; 1030 sh*le-*-netbsdelf*) 1031 targ_defvec=bfd_elf32_shlnbsd_vec 1032 targ_selvecs="bfd_elf32_shnbsd_vec shcoff_vec shlcoff_vec" 1033 ;; 1034 sh-*-netbsdelf*) 1035 targ_defvec=bfd_elf32_shnbsd_vec 1036 targ_selvecs="bfd_elf32_shlnbsd_vec shcoff_vec shlcoff_vec" 1037 #ifdef BFD64 1038 targ_selvecs="${targ_selvecs} bfd_elf32_sh64lnbsd_vec bfd_elf32_sh64nbsd_vec bfd_elf64_sh64lnbsd_vec bfd_elf64_sh64nbsd_vec" 1039 #endif 1040 ;; 1041 sh*-*-netbsdelf*) 1042 targ_defvec=bfd_elf32_shnbsd_vec 1043 targ_selvecs="bfd_elf32_shlnbsd_vec shcoff_vec shlcoff_vec" 1044 ;; 1045 1046 shl*-*-elf* | sh[1234]l*-*-elf* | sh3el*-*-elf* | shl*-*-kaos*) 1047 targ_defvec=bfd_elf32_shl_vec 1048 targ_selvecs="bfd_elf32_sh_vec shlcoff_vec shcoff_vec shlcoff_small_vec shcoff_small_vec" 1049 #ifdef BFD64 1050 targ_selvecs="${targ_selvecs} bfd_elf32_sh64_vec bfd_elf32_sh64l_vec bfd_elf64_sh64_vec bfd_elf64_sh64l_vec" 1051 #endif 1052 targ_underscore=yes 1053 ;; 1054 sh-*-elf* | sh[1234]*-elf* | sh-*-rtemself* | sh-*-kaos*) 1055 targ_defvec=bfd_elf32_sh_vec 1056 targ_selvecs="bfd_elf32_shl_vec shcoff_vec shlcoff_vec shcoff_small_vec shlcoff_small_vec" 1057 #ifdef BFD64 1058 targ_selvecs="${targ_selvecs} bfd_elf32_sh64_vec bfd_elf32_sh64l_vec bfd_elf64_sh64_vec bfd_elf64_sh64l_vec" 1059 #endif 1060 targ_underscore=yes 1061 ;; 1062 sh-*-nto*) 749 1063 targ_defvec=bfd_elf32_sh_vec 750 1064 targ_selvecs="bfd_elf32_shl_vec shcoff_vec shlcoff_vec shcoff_small_vec shlcoff_small_vec" … … 873 1187 targ_defvec=bfd_elf32_v850_vec 874 1188 ;; 875 #if HAVE_host_aout_vec 1189 1190 vax-*-netbsdelf*) 1191 targ_defvec=bfd_elf32_vax_vec 1192 targ_selvecs="vaxnetbsd_vec vax1knetbsd_vec" 1193 ;; 1194 1195 vax-*-netbsdaout* | vax-*-netbsd*) 1196 targ_defvec=vaxnetbsd_vec 1197 targ_selvecs="bfd_elf32_vax_vec vax1knetbsd_vec" 1198 targ_underscore=yes 1199 ;; 1200 876 1201 vax-*-bsd* | vax-*-ultrix*) 877 targ_defvec=host_aout_vec 878 targ_underscore=yes 879 ;; 880 #endif 1202 targ_defvec=vaxbsd_vec 1203 targ_underscore=yes 1204 ;; 881 1205 882 1206 vax*-*-*vms*) … … 890 1214 w65-*-*) 891 1215 targ_defvec=w65_vec 1216 ;; 1217 1218 xstormy16-*-elf) 1219 targ_defvec=bfd_elf32_xstormy16_vec 1220 ;; 1221 1222 xtensa-*-*) 1223 targ_defvec=bfd_elf32_xtensa_le_vec 1224 targ_selvecs=bfd_elf32_xtensa_be_vec 892 1225 ;; 893 1226 … … 930 1263 esac 931 1264 1265 case "${host64}${want64}" in 1266 *true*) 1267 targ_selvecs="${targ_selvecs} ${targ64_selvecs}" 1268 ;; 1269 esac 1270 932 1271 # If we support any ELF target, then automatically add support for the 933 1272 # generic ELF targets. This permits an objdump with some ELF support … … 935 1274 # relocation information. 936 1275 case "${targ_defvec} ${targ_selvecs}" in 937 *bfd_elf64* )1276 *bfd_elf64* | *bfd_elf32_n*mips*) 938 1277 targ_selvecs="${targ_selvecs} bfd_elf64_little_generic_vec bfd_elf64_big_generic_vec bfd_elf32_little_generic_vec bfd_elf32_big_generic_vec" 939 1278 ;; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/binutils/bfd/configure.in
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r617 r618 8 8 AC_ISC_POSIX 9 9 10 AM_INIT_AUTOMAKE(bfd, 2.11.2) 10 AM_INIT_AUTOMAKE(bfd, 2.14) 11 # Uncomment the next line to remove the date from the reported bfd version 12 #is_release=y 13 14 changequote(,)dnl 15 bfd_version=`echo "${VERSION}" | sed -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$/\1\2\3\4\5/'` 16 changequote([,])dnl 17 18 bfd_version_string="\"${VERSION}\"" 19 if test x${is_release} = x; then 20 bfd_version_date=`sed -n -e 's/.*DATE //p' < ${srcdir}/version.h` 21 bfd_version_string="\"${VERSION} ${bfd_version_date}\"" 22 fi 23 AC_SUBST(bfd_version) 24 AC_SUBST(bfd_version_string) 11 25 12 26 dnl These must be called before AM_PROG_LIBTOOL, because it may want … … 51 65 esac],[want_mmap=false])dnl 52 66 53 build_warnings="-W -Wall "67 build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" 54 68 AC_ARG_ENABLE(build-warnings, 55 69 [ --enable-build-warnings Enable build-time compiler warnings if gcc is used], … … 67 81 fi])dnl 68 82 WARN_CFLAGS="" 69 if test "x${build_warnings}" != x -a"x$GCC" = xyes ; then83 if test "x${build_warnings}" != x && test "x$GCC" = xyes ; then 70 84 WARN_CFLAGS="${build_warnings}" 71 85 fi … … 77 91 AC_MSG_ERROR(Unrecognized target system type; please check config.sub.) 78 92 fi 79 AC_ARG_PROGRAM80 93 81 94 AM_MAINTAINER_MODE 95 AM_INSTALL_LIBBFD 82 96 AC_EXEEXT 83 97 84 98 host64=false 85 99 target64=false 100 bfd_default_target_size=32 86 101 87 102 # host stuff: … … 89 104 AC_PROG_CC 90 105 91 ALL_LINGUAS= 106 ALL_LINGUAS="fr tr ja es sv da zh_CN" 92 107 CY_GNU_GETTEXT 93 108 … … 143 158 TRAD_HEADER='"hosts/alphalinux.h"' 144 159 ;; 145 alpha*-*-netbsd*) COREFILE=netbsd-core.lo ;; 160 alpha*-*-netbsd* | alpha*-*-openbsd*) 161 COREFILE=netbsd-core.lo 162 ;; 146 163 alpha*-*-*) COREFILE=osf-core.lo ;; 147 164 arm-*-freebsd*) COREFILE='' ;; 165 arm-*-netbsd*) COREFILE=netbsd-core.lo ;; 148 166 arm-*-riscix) COREFILE=trad-core.lo ;; 149 167 hppa*-*-hpux*) COREFILE=hpux-core.lo ;; … … 152 170 hppa*-*-bsd*) COREFILE="hpux-core.lo hppabsd-core.lo" 153 171 COREFLAG="-DHPUX_CORE -DHPPABSD_CORE" ;; 154 i370-*-*) 172 i370-*-*) 155 173 COREFILE=trad-core.lo 156 174 TRAD_HEADER='"hosts/i370linux.h"' … … 171 189 ;; 172 190 changequote(,)dnl 173 i[3456]86-*-bsd* | i[34567]86-*-freebsd[1234] | i[34567]86-*-freebsd[1234]\.* | i[34567]86-*-freebsd*aout*) 191 i[3456]86-*-bsdi) 192 changequote([,])dnl 193 COREFILE= 194 ;; 195 changequote(,)dnl 196 i[3456]86-*-bsd* | i[34567]86-*-freebsd[123] | i[34567]86-*-freebsd[123]\.* | i[34567]86-*-freebsd4\.[01234]* | i[34567]86-*-freebsd*aout*) 174 197 changequote([,])dnl 175 198 COREFILE=trad-core.lo … … 287 310 TRAD_HEADER='"hosts/m68kaux.h"' 288 311 ;; 289 m88*-*-sysv4*) ;; 290 m88*-motorola-sysv*) COREFILE=ptrace-core.lo ;; 312 m88*-*-sysv4*) 313 ;; 314 m88*-motorola-sysv*) 315 COREFILE=ptrace-core.lo 316 ;; 291 317 m88*-*-mach3*) 292 318 COREFILE=trad-core.lo … … 300 326 COREFILE=netbsd-core.lo 301 327 ;; 302 rs6000-*-lynx*) COREFILE=lynx-core.lo ;; 328 rs6000-*-lynx*) 329 COREFILE=lynx-core.lo 330 ;; 331 rs6000-*-aix5.* | powerpc-*-aix5.*) 332 COREFILE=rs6000-core.lo 333 COREFLAG="$COREFLAG -DAIX_5_CORE -DAIX_CORE_DUMPX_CORE" 334 ;; 303 335 changequote(,)dnl 304 336 rs6000-*-aix4.[3-9]* | powerpc-*-aix4.[3-9]*) … … 306 338 COREFILE=rs6000-core.lo 307 339 COREFLAG="$COREFLAG -DAIX_CORE_DUMPX_CORE" 340 # Not all versions of AIX with -DAIX_CORE_DUMPX_CORE 341 # have c_impl as a member of struct core_dumpx 342 AC_MSG_CHECKING([for c_impl in struct core_dumpx]) 343 AC_TRY_COMPILE([#include <core.h>], 344 [struct core_dumpx c; c.c_impl = 0;], 345 [AC_DEFINE(HAVE_ST_C_IMPL, 1, 346 [Define if struct core_dumpx has member c_impl]) 347 AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)]) 308 348 ;; 309 349 rs6000-*-aix4*) COREFILE=rs6000-core.lo ;; … … 315 355 powerpc-*-netbsd*) COREFILE=netbsd-core.lo ;; 316 356 powerpc-*-*bsd*) COREFILE=netbsd-core.lo ;; 317 sparc-*-netbsd* | sparc-*-openbsd*) 357 s390*-*-*) COREFILE=trad-core.lo ;; 358 sh*-*-netbsd*) COREFILE=netbsd-core.lo ;; 359 sparc-*-netbsd* | sparc*-*-openbsd*) 318 360 COREFILE=netbsd-core.lo 319 361 ;; … … 322 364 TRAD_HEADER='"hosts/tahoe.h"' 323 365 ;; 366 vax-*-netbsd*) COREFILE=netbsd-core.lo ;; 324 367 vax-*-ultrix2*) 325 368 COREFILE=trad-core.lo … … 334 377 TRAD_HEADER='"hosts/vaxbsd.h"' 335 378 ;; 379 x86_64-*-netbsd*) COREFILE=netbsd-core.lo ;; 336 380 esac 337 381 … … 395 439 fi 396 440 ;; 441 *-*-linux*) 442 # We borrow WIN32LIBADD so that the shared libbfd won't depend on 443 # libiberty.a. 444 case "${host}" in 445 mips*-*-linux*) 446 # Linux/MIPS uses PIC by default. 447 if test "$enable_shared" = "yes"; then 448 WIN32LIBADD="-L../libiberty -liberty" 449 fi 450 ;; 451 *) 452 changequote(,)dnl 453 x=`sed -n -e 's/^[ ]*PICFLAG[ ]*=[ ]*//p' < ../libiberty/Makefile | sed -n '$p'` 454 changequote([,])dnl 455 if test -n "$x"; then 456 WIN32LIBADD="-L../libiberty/pic -liberty" 457 fi 458 ;; 459 esac 460 ;; 397 461 esac 398 462 AC_SUBST(WIN32LDFLAGS) … … 418 482 defvec= 419 483 selvecs= 484 assocvecs= 420 485 selarchs= 421 486 TDEFINES= … … 424 489 if test "x$targ" = "xall"; then 425 490 all_targets=true 491 assocvecs="$assocvecs $targ_defvec $targ_selvecs" 426 492 else 427 493 . $srcdir/config.bfd … … 454 520 455 521 522 # uniq the associated vectors in all the configured targets. 523 f="" 524 for i in $assocvecs ; do 525 case " $f " in 526 *" $i "*) ;; 527 *) f="$f $i" ;; 528 esac 529 done 530 assocvecs="$f" 531 532 456 533 # uniq the architectures in all the configured targets. 457 534 f="" … … 467 544 tb= 468 545 469 elf="elf.lo elflink.lo dwarf1.lo"546 elf="elf.lo elflink.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo" 470 547 471 548 for vec in $selvecs 472 549 do 550 target_size=32 473 551 case "$vec" in 474 552 # This list is alphabetized to make it easy to compare 475 # with the two vector lists in targets.c. 553 # with the two vector lists in targets.c. For the same reason, 554 # use one entry per line, even though this leads to long lines. 476 555 a29kcoff_big_vec) tb="$tb coff-a29k.lo cofflink.lo" ;; 477 556 a_out_adobe_vec) tb="$tb aout-adobe.lo aout32.lo" ;; 478 armcoff_little_vec) tb="$tb coff-arm.lo cofflink.lo " ;; 479 armcoff_big_vec) tb="$tb coff-arm.lo cofflink.lo " ;; 480 armnetbsd_vec) tb="$tb armnetbsd.lo aout32.lo" ;; 481 armpe_little_vec) tb="$tb pe-arm.lo peigen.lo cofflink.lo " ;; 482 armpe_big_vec) tb="$tb pe-arm.lo peigen.lo cofflink.lo " ;; 483 armpei_little_vec) tb="$tb pei-arm.lo peigen.lo cofflink.lo " ;; 484 armpei_big_vec) tb="$tb pei-arm.lo peigen.lo cofflink.lo " ;; 485 arm_epoc_pe_little_vec) tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;; 486 arm_epoc_pe_big_vec) tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;; 487 arm_epoc_pei_little_vec) tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;; 488 arm_epoc_pei_big_vec) tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;; 557 aix5coff64_vec) tb="$tb coff64-rs6000.lo xcofflink.lo aix5ppc-core.lo"; target_size=64 ;; 489 558 aout0_big_vec) tb="$tb aout0.lo aout32.lo" ;; 490 559 aout_arm_big_vec) tb="$tb aout-arm.lo aout32.lo" ;; … … 493 562 aout_mips_little_vec) tb="$tb mipsbsd.lo aout32.lo" ;; 494 563 apollocoff_vec) tb="$tb coff-apollo.lo" ;; 564 arm_epoc_pe_big_vec) tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;; 565 arm_epoc_pe_little_vec) tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;; 566 arm_epoc_pei_big_vec) tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;; 567 arm_epoc_pei_little_vec) tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;; 568 armcoff_big_vec) tb="$tb coff-arm.lo cofflink.lo " ;; 569 armcoff_little_vec) tb="$tb coff-arm.lo cofflink.lo " ;; 570 armnetbsd_vec) tb="$tb armnetbsd.lo aout32.lo" ;; 571 armpe_big_vec) tb="$tb pe-arm.lo peigen.lo cofflink.lo " ;; 572 armpe_little_vec) tb="$tb pe-arm.lo peigen.lo cofflink.lo " ;; 573 armpei_big_vec) tb="$tb pei-arm.lo peigen.lo cofflink.lo " ;; 574 armpei_little_vec) tb="$tb pei-arm.lo peigen.lo cofflink.lo " ;; 495 575 b_out_vec_big_host) tb="$tb bout.lo aout32.lo" ;; 496 576 b_out_vec_little_host) tb="$tb bout.lo aout32.lo" ;; 497 577 bfd_efi_app_ia32_vec) tb="$tb efi-app-ia32.lo peigen.lo cofflink.lo" ;; 498 bfd_efi_app_ia64_vec) tb="$tb efi-app-ia64.lo pepigen.lo cofflink.lo" 499 target64=true ;; 500 bfd_elf64_alpha_vec) tb="$tb elf64-alpha.lo elf64.lo $elf" 501 target64=true ;; 502 bfd_elf64_hppa_vec | bfd_elf64_hppa_linux_vec) 503 tb="$tb elf64-hppa.lo elf64.lo $elf" 504 target64=true ;; 505 bfd_elf64_ia64_little_vec) tb="$tb elf64-ia64.lo elf64.lo $elf" 506 target64=true ;; 507 bfd_elf64_ia64_big_vec) tb="$tb elf64-ia64.lo elf64.lo $elf" 508 target64=true ;; 509 bfd_elf32_ia64_big_vec) tb="$tb elf32-ia64.lo elf32.lo $elf" ;; 578 bfd_efi_app_ia64_vec) tb="$tb efi-app-ia64.lo pepigen.lo cofflink.lo"; target_size=64 ;; 510 579 bfd_elf32_avr_vec) tb="$tb elf32-avr.lo elf32.lo $elf" ;; 511 bfd_elf32_littlearc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;; 512 bfd_elf32_littlearm_vec) tb="$tb elfarm-nabi.lo elf32.lo $elf" ;; 513 bfd_elf32_littlearm_oabi_vec) tb="$tb elfarm-oabi.lo elf32.lo $elf" ;; 580 bfd_elf32_big_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;; 514 581 bfd_elf32_bigarc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;; 582 bfd_elf32_bigarm_oabi_vec) tb="$tb elfarm-oabi.lo elf32.lo $elf" ;; 515 583 bfd_elf32_bigarm_vec) tb="$tb elfarm-nabi.lo elf32.lo $elf" ;; 516 bfd_elf32_bigarm_oabi_vec) tb="$tb elfarm-oabi.lo elf32.lo $elf" ;; 517 bfd_elf32_big_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;; 518 bfd_elf32_bigmips_vec) tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;; 519 bfd_elf64_bigmips_vec) tb="$tb elf64-mips.lo elf64.lo elf32-mips.lo elf32.lo $elf ecofflink.lo" 520 target64=true ;; 584 bfd_elf32_bigmips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;; 521 585 bfd_elf32_cris_vec) tb="$tb elf32-cris.lo elf32.lo $elf" ;; 522 bfd_elf32_us_cris_vec) tb="$tb elf32-cris.lo elf32.lo $elf" ;;523 586 bfd_elf32_d10v_vec) tb="$tb elf32-d10v.lo elf32.lo $elf" ;; 524 587 bfd_elf32_d30v_vec) tb="$tb elf32-d30v.lo elf32.lo $elf" ;; 588 bfd_elf32_dlx_big_vec) tb="$tb elf32-dlx.lo elf32.lo $elf" ;; 525 589 bfd_elf32_fr30_vec) tb="$tb elf32-fr30.lo elf32.lo $elf" ;; 526 bfd_elf32_hppa_vec | bfd_elf32_hppa_linux_vec) 527 tb="$tb elf32-hppa.lo elf32.lo $elf" ;; 590 bfd_elf32_frv_vec) tb="$tb elf32-frv.lo elf32.lo $elf" ;; 591 bfd_elf32_h8300_vec) tb="$tb elf32-h8300.lo elf32.lo $elf" ;; 592 bfd_elf32_hppa_linux_vec) tb="$tb elf32-hppa.lo elf32.lo $elf" ;; 593 bfd_elf32_hppa_vec) tb="$tb elf32-hppa.lo elf32.lo $elf" ;; 528 594 bfd_elf32_i370_vec) tb="$tb elf32-i370.lo elf32.lo $elf" ;; 595 bfd_elf32_i386_freebsd_vec) tb="$tb elf32-i386.lo elf32.lo $elf" ;; 529 596 bfd_elf32_i386_vec) tb="$tb elf32-i386.lo elf32.lo $elf" ;; 530 bfd_elf64_x86_64_vec) tb="$tb elf64-x86-64.lo elf64.lo $elf" 531 target64=true ;; 597 bfd_elf32_i860_little_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;; 532 598 bfd_elf32_i860_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;; 533 bfd_elf32_i860_little_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;;534 599 bfd_elf32_i960_vec) tb="$tb elf32-i960.lo elf32.lo $elf" ;; 600 bfd_elf32_ia64_big_vec) tb="$tb elf32-ia64.lo elf32.lo $elf" ;; 601 bfd_elf32_ia64_hpux_big_vec) tb="$tb elf32-ia64.lo elf32.lo $elf";; 602 bfd_elf32_ip2k_vec) tb="$tb elf32-ip2k.lo elf32.lo $elf" ;; 603 bfd_elf32_iq2000_vec) tb="$tb elf32-iq2000.lo elf32.lo $elf" ;; 535 604 bfd_elf32_little_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;; 536 bfd_elf32_littlemips_vec) tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;; 537 bfd_elf64_littlemips_vec) tb="$tb elf64-mips.lo elf64.lo elf32-mips.lo elf32.lo $elf ecofflink.lo" 538 target64=true ;; 605 bfd_elf32_littlearc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;; 606 bfd_elf32_littlearm_oabi_vec) tb="$tb elfarm-oabi.lo elf32.lo $elf" ;; 607 bfd_elf32_littlearm_vec) tb="$tb elfarm-nabi.lo elf32.lo $elf" ;; 608 bfd_elf32_littlemips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;; 539 609 bfd_elf32_m32r_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;; 540 bfd_elf32_m68hc11_vec) tb="$tb elf32-m68hc11.lo elf32 .lo $elf" ;;541 bfd_elf32_m68hc12_vec) tb="$tb elf32-m68hc12.lo elf32 .lo $elf" ;;610 bfd_elf32_m68hc11_vec) tb="$tb elf32-m68hc11.lo elf32-m68hc1x.lo elf32.lo $elf" ;; 611 bfd_elf32_m68hc12_vec) tb="$tb elf32-m68hc12.lo elf32-m68hc1x.lo elf32.lo $elf" ;; 542 612 bfd_elf32_m68k_vec) tb="$tb elf32-m68k.lo elf32.lo $elf" ;; 543 613 bfd_elf32_m88k_vec) tb="$tb elf32-m88k.lo elf32.lo $elf" ;; … … 546 616 bfd_elf32_mn10200_vec) tb="$tb elf-m10200.lo elf32.lo $elf" ;; 547 617 bfd_elf32_mn10300_vec) tb="$tb elf-m10300.lo elf32.lo $elf" ;; 618 bfd_elf32_msp430_vec) tb="$tb elf32-msp430.lo elf32.lo $elf" ;; 619 bfd_elf32_nbigmips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; 620 bfd_elf32_nlittlemips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; 621 bfd_elf32_ntradbigmips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; 622 bfd_elf32_ntradlittlemips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; 623 bfd_elf32_openrisc_vec) tb="$tb elf32-openrisc.lo elf32.lo $elf" ;; 624 bfd_elf32_or32_big_vec) tb="$tb elf32-or32.lo elf32.lo $elf" ;; 548 625 bfd_elf32_pj_vec) tb="$tb elf32-pj.lo elf32.lo $elf";; 549 626 bfd_elf32_pjl_vec) tb="$tb elf32-pj.lo elf32.lo $elf";; 550 627 bfd_elf32_powerpc_vec) tb="$tb elf32-ppc.lo elf32.lo $elf" ;; 551 628 bfd_elf32_powerpcle_vec) tb="$tb elf32-ppc.lo elf32.lo $elf" ;; 629 bfd_elf32_s390_vec) tb="$tb elf32-s390.lo elf32.lo $elf" ;; 630 # FIXME: We include cofflink.lo not because it's needed for 631 # bfd_elf32_sh64[l]_vec, but because we include bfd_elf32_sh[l]_vec 632 # which needs it but does not list it. Should be fixed in right place. 633 bfd_elf32_sh64_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;; 634 bfd_elf32_sh64l_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;; 635 bfd_elf32_sh64lin_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;; 636 bfd_elf32_sh64blin_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;; 637 bfd_elf32_sh64lnbsd_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" ;; 638 bfd_elf32_sh64nbsd_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" ;; 552 639 bfd_elf32_sh_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;; 640 bfd_elf32_shblin_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; 553 641 bfd_elf32_shl_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;; 554 bfd_elf32_shlin_vec) tb="$tb elf32-sh-lin.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; 555 bfd_elf32_shblin_vec) tb="$tb elf32-sh-lin.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; 642 bfd_elf32_shlin_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; 643 bfd_elf32_shlnbsd_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; 644 bfd_elf32_shnbsd_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; 556 645 bfd_elf32_sparc_vec) tb="$tb elf32-sparc.lo elf32.lo $elf" ;; 557 bfd_elf32_tradbigmips_vec) tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;; 558 bfd_elf32_tradlittlemips_vec) tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;; 646 bfd_elf32_tradbigmips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;; 647 bfd_elf32_tradlittlemips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;; 648 bfd_elf32_us_cris_vec) tb="$tb elf32-cris.lo elf32.lo $elf" ;; 559 649 bfd_elf32_v850_vec) tb="$tb elf32-v850.lo elf32.lo $elf" ;; 560 bfd_elf64_big_generic_vec) tb="$tb elf64-gen.lo elf64.lo $elf" 561 target64=true ;; 562 bfd_elf64_little_generic_vec) tb="$tb elf64-gen.lo elf64.lo $elf" 563 target64=true ;; 564 bfd_elf64_sparc_vec) tb="$tb elf64-sparc.lo elf64.lo $elf" 565 target64=true ;; 566 bfd_elf64_tradbigmips_vec) tb="$tb elf64-mips.lo elf64.lo $elf ecofflink.lo" 567 target64=true ;; 568 bfd_elf64_tradlittlemips_vec) tb="$tb elf64-mips.lo elf64.lo $elf ecofflink.lo" 569 target64=true ;; 570 cisco_core_big_vec) tb="$tb cisco-core.lo" ;; 571 cisco_core_little_vec) tb="$tb cisco-core.lo" ;; 650 bfd_elf32_vax_vec) tb="$tb elf32-vax.lo elf32.lo $elf" ;; 651 bfd_elf32_xstormy16_vec) tb="$tb elf32-xstormy16.lo elf32.lo $elf" ;; 652 bfd_elf32_xtensa_le_vec) tb="$tb xtensa-isa.lo xtensa-modules.lo elf32-xtensa.lo elf32.lo $elf" ;; 653 bfd_elf32_xtensa_be_vec) tb="$tb xtensa-isa.lo xtensa-modules.lo elf32-xtensa.lo elf32.lo $elf" ;; 654 bfd_elf64_alpha_freebsd_vec) tb="$tb elf64-alpha.lo elf64.lo $elf"; target_size=64 ;; 655 bfd_elf64_alpha_vec) tb="$tb elf64-alpha.lo elf64.lo $elf"; target_size=64 ;; 656 bfd_elf64_big_generic_vec) tb="$tb elf64-gen.lo elf64.lo $elf"; target_size=64 ;; 657 bfd_elf64_bigmips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; 658 bfd_elf64_hppa_linux_vec) tb="$tb elf64-hppa.lo elf64.lo $elf"; target_size=64 ;; 659 bfd_elf64_hppa_vec) tb="$tb elf64-hppa.lo elf64.lo $elf"; target_size=64 ;; 660 bfd_elf64_ia64_aix_big_vec) tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;; 661 bfd_elf64_ia64_aix_little_vec) tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;; 662 bfd_elf64_ia64_big_vec) tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;; 663 bfd_elf64_ia64_hpux_big_vec) tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;; 664 bfd_elf64_ia64_little_vec) tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;; 665 bfd_elf64_little_generic_vec) tb="$tb elf64-gen.lo elf64.lo $elf"; target_size=64 ;; 666 bfd_elf64_littlemips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; 667 bfd_elf64_mmix_vec) tb="$tb elf64-mmix.lo elf64.lo $elf" target_size=64 ;; 668 bfd_elf64_powerpc_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf"; target_size=64 ;; 669 bfd_elf64_powerpcle_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf" target_size=64 ;; 670 bfd_elf64_s390_vec) tb="$tb elf64-s390.lo elf64.lo $elf"; target_size=64 ;; 671 bfd_elf64_sh64_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; 672 bfd_elf64_sh64l_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; 673 bfd_elf64_sh64lin_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; 674 bfd_elf64_sh64blin_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; 675 bfd_elf64_sh64lnbsd_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; 676 bfd_elf64_sh64nbsd_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; 677 bfd_elf64_sparc_vec) tb="$tb elf64-sparc.lo elf64.lo $elf"; target_size=64 ;; 678 bfd_elf64_tradbigmips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; 679 bfd_elf64_tradlittlemips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; 680 bfd_elf64_x86_64_vec) tb="$tb elf64-x86-64.lo elf64.lo $elf"; target_size=64 ;; 681 bfd_mmo_vec) tb="$tb mmo.lo" target_size=64 ;; 682 bfd_powerpc_pe_vec) tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;; 683 bfd_powerpc_pei_vec) tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;; 684 bfd_powerpcle_pe_vec) tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;; 685 bfd_powerpcle_pei_vec) tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;; 572 686 cris_aout_vec) tb="$tb aout-cris.lo" ;; 573 demo_64_vec) tb="$tb demo64.lo aout64.lo" 574 target64=true ;; 687 demo_64_vec) tb="$tb demo64.lo aout64.lo"; target_size=64 ;; 575 688 ecoff_big_vec) tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;; 689 ecoff_biglittle_vec) tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;; 576 690 ecoff_little_vec) tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;; 577 ecoff_biglittle_vec) tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;; 578 ecoffalpha_little_vec) tb="$tb coff-alpha.lo ecoff.lo ecofflink.lo" 579 target64=true ;; 691 ecoffalpha_little_vec) tb="$tb coff-alpha.lo ecoff.lo ecofflink.lo"; target_size=64 ;; 580 692 go32coff_vec) tb="$tb coff-go32.lo cofflink.lo" ;; 581 693 go32stubbedcoff_vec) tb="$tb coff-stgo32.lo cofflink.lo" ;; … … 590 702 i386dynix_vec) tb="$tb i386dynix.lo aout32.lo" ;; 591 703 i386freebsd_vec) tb="$tb i386freebsd.lo aout32.lo" ;; 592 i386msdos_vec) tb="$tb i386msdos.lo" ;;593 i386pe_vec) tb="$tb pe-i386.lo peigen.lo cofflink.lo" ;;594 i386pei_vec) tb="$tb pei-i386.lo peigen.lo cofflink.lo" ;;595 704 i386linux_vec) tb="$tb i386linux.lo aout32.lo" ;; 596 705 i386lynx_aout_vec) tb="$tb i386lynx.lo lynx-core.lo aout32.lo" ;; 597 706 i386lynx_coff_vec) tb="$tb cf-i386lynx.lo cofflink.lo lynx-core.lo" ;; 598 707 i386mach3_vec) tb="$tb i386mach3.lo aout32.lo" ;; 708 i386msdos_vec) tb="$tb i386msdos.lo" ;; 599 709 i386netbsd_vec) tb="$tb i386netbsd.lo aout32.lo" ;; 600 710 i386os9k_vec) tb="$tb i386os9k.lo aout32.lo" ;; 601 i386aout_emx_vec) tb="$tb i386aoutemx.lo aout32.lo " ;; 711 i386aout_emx_vec) tb="$tb i386aoutemx.lo aout32.lo" ;; 712 i386pe_vec) tb="$tb pe-i386.lo peigen.lo cofflink.lo" ;; 713 i386pei_vec) tb="$tb pei-i386.lo peigen.lo cofflink.lo" ;; 602 714 i860coff_vec) tb="$tb coff-i860.lo cofflink.lo" ;; 603 715 icoff_big_vec) tb="$tb coff-i960.lo cofflink.lo" ;; 604 716 icoff_little_vec) tb="$tb coff-i960.lo cofflink.lo" ;; 605 717 ieee_vec) tb="$tb ieee.lo" ;; 718 m68k4knetbsd_vec) tb="$tb m68k4knetbsd.lo aout32.lo" ;; 719 m68kaux_coff_vec) tb="$tb coff-aux.lo coff-m68k.lo cofflink.lo" ;; 606 720 m68kcoff_vec) tb="$tb coff-m68k.lo cofflink.lo" ;; 607 721 m68kcoffun_vec) tb="$tb coff-u68k.lo coff-m68k.lo cofflink.lo" ;; … … 610 724 m68klynx_coff_vec) tb="$tb cf-m68klynx.lo coff-m68k.lo cofflink.lo lynx-core.lo" ;; 611 725 m68knetbsd_vec) tb="$tb m68knetbsd.lo aout32.lo" ;; 612 m68k4knetbsd_vec) tb="$tb m68k4knetbsd.lo aout32.lo" ;;613 m68kaux_coff_vec) tb="$tb coff-aux.lo coff-m68k.lo cofflink.lo" ;;614 726 m68ksysvcoff_vec) tb="$tb coff-svm68k.lo cofflink.lo" ;; 615 727 m88kbcs_vec) tb="$tb coff-m88k.lo" ;; 616 mipslpe_vec) tb="$tb pe-mips.lo peigen.lo cofflink.lo" ;; 617 mipslpei_vec) tb="$tb pei-mips.lo peigen.lo cofflink.lo" ;; 728 m88kmach3_vec) tb="$tb m88kmach3.lo aout32.lo" ;; 729 mach_o_be_vec) tb="$tb mach-o.lo" ;; 730 mach_o_le_vec) tb="$tb mach-o.lo" ;; 731 mach_o_fat_vec) tb="$tb mach-o.lo" ;; 618 732 mcore_pe_big_vec) tb="$tb pe-mcore.lo peigen.lo cofflink.lo" ;; 619 733 mcore_pe_little_vec) tb="$tb pe-mcore.lo peigen.lo cofflink.lo" ;; 620 734 mcore_pei_big_vec) tb="$tb pei-mcore.lo peigen.lo cofflink.lo" ;; 621 735 mcore_pei_little_vec) tb="$tb pei-mcore.lo peigen.lo cofflink.lo" ;; 736 mipslpe_vec) tb="$tb pe-mips.lo peigen.lo cofflink.lo" ;; 737 mipslpei_vec) tb="$tb pei-mips.lo peigen.lo cofflink.lo" ;; 622 738 newsos3_vec) tb="$tb newsos3.lo aout32.lo" ;; 739 nlm32_alpha_vec) tb="$tb nlm32-alpha.lo nlm32.lo nlm.lo"; target_size=64 ;; 623 740 nlm32_i386_vec) tb="$tb nlm32-i386.lo nlm32.lo nlm.lo" ;; 624 rs6000coff64_vec) tb="$tb coff64-rs6000.lo xcofflink.lo" 625 target64=true ;; 741 nlm32_powerpc_vec) tb="$tb nlm32-ppc.lo nlm32.lo nlm.lo" ;; 626 742 nlm32_sparc_vec) tb="$tb nlm32-sparc.lo nlm32.lo nlm.lo" ;; 627 nlm32_alpha_vec) tb="$tb nlm32-alpha.lo nlm32.lo nlm.lo" 628 target64=true ;; 743 or32coff_big_vec) tb="$tb coff-or32.lo cofflink.lo" ;; 744 pc532machaout_vec) tb="$tb pc532-mach.lo aout-ns32k.lo" ;; 745 pc532netbsd_vec) tb="$tb ns32knetbsd.lo aout-ns32k.lo" ;; 746 pef_vec) tb="$tb pef.lo" ;; 747 pef_xlib_vec) tb="$tb pef.lo" ;; 748 pdp11_aout_vec) tb="$tb pdp11.lo" ;; 749 pmac_xcoff_vec) tb="$tb coff-rs6000.lo xcofflink.lo" ;; 750 ppcboot_vec) tb="$tb ppcboot.lo" ;; 629 751 riscix_vec) tb="$tb aout32.lo riscix.lo" ;; 630 nlm32_powerpc_vec) tb="$tb nlm32-ppc.lo nlm32.lo nlm.lo" ;; 631 pc532netbsd_vec) tb="$tb ns32knetbsd.lo aout-ns32k.lo" ;; 632 pc532machaout_vec) tb="$tb pc532-mach.lo aout-ns32k.lo" ;; 633 pmac_xcoff_vec) tb="$tb coff-pmac.lo xcofflink.lo" ;; 752 rs6000coff64_vec) tb="$tb coff64-rs6000.lo xcofflink.lo aix5ppc-core.lo"; target_size=64 ;; 634 753 rs6000coff_vec) tb="$tb coff-rs6000.lo xcofflink.lo" ;; 635 bfd_powerpc_pe_vec) tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;; 636 bfd_powerpcle_pe_vec) tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;; 637 bfd_powerpc_pei_vec) tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;; 638 bfd_powerpcle_pei_vec) tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;; 639 ppcboot_vec) tb="$tb ppcboot.lo" ;; 754 shcoff_small_vec) tb="$tb coff-sh.lo cofflink.lo" ;; 640 755 shcoff_vec) tb="$tb coff-sh.lo cofflink.lo" ;; 756 shlcoff_small_vec) tb="$tb coff-sh.lo cofflink.lo" ;; 641 757 shlcoff_vec) tb="$tb coff-sh.lo cofflink.lo" ;; 642 shcoff_small_vec) tb="$tb coff-sh.lo cofflink.lo" ;;643 shlcoff_small_vec) tb="$tb coff-sh.lo cofflink.lo" ;;644 758 shlpe_vec) tb="$tb pe-sh.lo coff-sh.lo peigen.lo cofflink.lo" ;; 645 759 shlpei_vec) tb="$tb pei-sh.lo coff-sh.lo peigen.lo cofflink.lo" ;; 646 760 som_vec) tb="$tb som.lo" ;; 761 sparccoff_vec) tb="$tb coff-sparc.lo" ;; 647 762 sparcle_aout_vec) tb="$tb aout-sparcle.lo aout32.lo" ;; 648 763 sparclinux_vec) tb="$tb sparclinux.lo aout32.lo" ;; … … 650 765 sparclynx_coff_vec) tb="$tb cf-sparclynx.lo lynx-core.lo" ;; 651 766 sparcnetbsd_vec) tb="$tb sparcnetbsd.lo aout32.lo" ;; 652 sparccoff_vec) tb="$tb coff-sparc.lo" ;;653 srec_vec) tb="$tb srec.lo" ;;654 767 sunos_big_vec) tb="$tb sunos.lo aout32.lo" ;; 655 symbolsrec_vec) tb="$tb srec.lo" ;; 656 tekhex_vec) tb="$tb tekhex.lo" ;; 768 sym_vec) tb="$tb xsym.lo" ;; 657 769 tic30_aout_vec) tb="$tb aout-tic30.lo" ;; 658 770 tic30_coff_vec) tb="$tb coff-tic30.lo" ;; 771 tic4x_coff0_vec) tb="$tb coff-tic4x.lo" ;; 772 tic4x_coff0_beh_vec) tb="$tb coff-tic4x.lo" ;; 773 tic4x_coff1_vec) tb="$tb coff-tic4x.lo" ;; 774 tic4x_coff1_beh_vec) tb="$tb coff-tic4x.lo" ;; 775 tic4x_coff2_vec) tb="$tb coff-tic4x.lo" ;; 776 tic4x_coff2_beh_vec) tb="$tb coff-tic4x.lo" ;; 777 tic54x_coff0_beh_vec) tb="$tb coff-tic54x.lo" ;; 659 778 tic54x_coff0_vec) tb="$tb coff-tic54x.lo" ;; 660 tic54x_coff 0_beh_vec) tb="$tb coff-tic54x.lo" ;;779 tic54x_coff1_beh_vec) tb="$tb coff-tic54x.lo" ;; 661 780 tic54x_coff1_vec) tb="$tb coff-tic54x.lo" ;; 662 tic54x_coff 1_beh_vec) tb="$tb coff-tic54x.lo" ;;781 tic54x_coff2_beh_vec) tb="$tb coff-tic54x.lo" ;; 663 782 tic54x_coff2_vec) tb="$tb coff-tic54x.lo" ;; 664 tic54x_coff2_beh_vec) tb="$tb coff-tic54x.lo" ;;665 783 tic80coff_vec) tb="$tb coff-tic80.lo cofflink.lo" ;; 784 vaxnetbsd_vec) tb="$tb vaxnetbsd.lo aout32.lo" ;; 785 vax1knetbsd_vec) tb="$tb vax1knetbsd.lo aout32.lo" ;; 786 vaxbsd_vec) tb="$tb vaxbsd.lo aout32.lo" ;; 666 787 versados_vec) tb="$tb versados.lo" ;; 667 vms_alpha_vec) tb="$tb vms.lo vms-hdr.lo vms-gsd.lo vms-tir.lo vms-misc.lo" 668 target64=true ;; 788 vms_alpha_vec) tb="$tb vms.lo vms-hdr.lo vms-gsd.lo vms-tir.lo vms-misc.lo"; target_size=64 ;; 669 789 vms_vax_vec) tb="$tb vms.lo vms-hdr.lo vms-gsd.lo vms-tir.lo vms-misc.lo" ;; 670 790 w65_vec) tb="$tb coff-w65.lo reloc16.lo" ;; … … 672 792 z8kcoff_vec) tb="$tb coff-z8k.lo reloc16.lo" ;; 673 793 794 # These appear out of order in targets.c 795 srec_vec) tb="$tb srec.lo" ;; 796 symbolsrec_vec) tb="$tb srec.lo" ;; 797 tekhex_vec) tb="$tb tekhex.lo" ;; 798 cisco_core_big_vec) tb="$tb cisco-core.lo" ;; 799 cisco_core_little_vec) tb="$tb cisco-core.lo" ;; 800 674 801 "") ;; 675 802 *) AC_MSG_ERROR(*** unknown target vector $vec) ;; 676 803 esac 804 805 if test ${target_size} = 64; then 806 target64=true 807 fi 808 if test x"${vec}" = x"${defvec}"; then 809 bfd_default_target_size=${target_size} 810 fi 677 811 done 678 812 … … 710 844 havevecs= 711 845 selarchs= 846 test -n "$assocvecs" && 847 assocvecs=`echo $assocvecs | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'` 712 848 else # all_targets is true 713 849 # Only set these if they will be nonempty, for the clever echo. 714 850 havevecs= 851 assocvecs= 715 852 test -n "$selvecs" && 716 853 havevecs=`echo $selvecs | sed -e 's/^/-DHAVE_/' -e 's/ \(.\)/ -DHAVE_\1/g'` … … 724 861 *true*) 725 862 wordsize=64 863 bfd_libs='$(BFD64_LIBS) $(BFD32_LIBS)' 726 864 all_backends='$(BFD64_BACKENDS) $(BFD32_BACKENDS)' 727 865 if test -z "$GCC" && test "$BFD_HOST_64BIT_LONG" = "0" && test "$BFD_HOST_64_BIT_DEFINED" = "0"; then … … 729 867 AC_MSG_WARN([your compiler may not have a 64 bit integral type]) 730 868 fi 869 if test -n "$GCC" ; then 870 bad_64bit_gcc=no; 871 AC_MSG_CHECKING([for gcc version with buggy 64-bit support]) 872 # Add more tests for gcc versions with non-working 64-bit support here. 873 AC_EGREP_CPP([: 2 : 91 : 1 :],[:__GNUC__:__GNUC_MINOR__:__i386__:], 874 bad_64bit_gcc=yes; 875 AC_MSG_RESULT([yes: egcs-1.1.2 on ix86 spotted]), 876 AC_MSG_RESULT(no)) 877 if test $bad_64bit_gcc = yes ; then 878 AC_ERROR([A newer version of gcc is needed for the requested 64-bit BFD configuration]) 879 fi 880 fi 731 881 ;; 732 882 false-false-false) 733 883 wordsize=32 884 bfd_libs='$(BFD32_LIBS)' 734 885 all_backends='$(BFD32_BACKENDS)' 735 886 ;; … … 737 888 738 889 AC_SUBST(wordsize) 890 AC_SUBST(bfd_libs) 739 891 AC_SUBST(all_backends) 740 892 AC_SUBST(bfd_backends) 741 893 AC_SUBST(bfd_machines) 894 AC_SUBST(bfd_default_target_size) 742 895 743 896 tdefaults="" 744 897 test -n "${defvec}" && tdefaults="${tdefaults} -DDEFAULT_VECTOR=${defvec}" 745 898 test -n "${selvecs}" && tdefaults="${tdefaults} -DSELECT_VECS='${selvecs}'" 899 test -n "${assocvecs}" && tdefaults="${tdefaults} -DASSOCIATED_VECS='${assocvecs}'" 746 900 test -n "${selarchs}" && tdefaults="${tdefaults} -DSELECT_ARCHITECTURES='${selarchs}'" 747 901 test -n "${havevecs}" && tdefaults="${tdefaults} ${havevecs}" … … 756 910 757 911 rm -f doc/config.status 758 AC_OUTPUT(Makefile doc/Makefile bfd-in3.h:bfd-in2.h po/Makefile.in:po/Make-in,912 AC_OUTPUT(Makefile doc/Makefile bfd-in3.h:bfd-in2.h bfdver.h:version.h po/Makefile.in:po/Make-in, 759 913 [sed -e '/SRC-POTFILES =/r po/SRC-POTFILES' -e '/BLD-POTFILES =/r po/BLD-POTFILES' po/Makefile.in > po/Makefile]) 760 914 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/binutils/bfd/host-aout.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r617 r618 1 1 /* BFD backend for local host's a.out binaries 2 Copyright 1990, 1991, 1992, 1994, 1995 Free Software Foundation, Inc. 2 Copyright 1990, 1991, 1992, 1994, 1995, 2001 3 Free Software Foundation, Inc. 3 4 Written by Cygnus Support. Probably John Gilmore's fault. 4 5 … … 81 82 #endif /* HOST_MACHINE_ARCH */ 82 83 83 #define MY(OP) CAT(host_aout_,OP) 84 /* Do not "beautify" the CONCAT* macro args. Traditional C will not 85 remove whitespace added here, and thus will fail to concatenate 86 the tokens. */ 87 #define MY(OP) CONCAT2 (host_aout_,OP) 84 88 #define TARGETNAME "a.out" 85 89 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/binutils/bfd/libaout.h
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r617 r618 1 1 /* BFD back-end data structures for a.out (and similar) files. 2 2 Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 3 2000, 2001 3 2000, 2001, 2002 4 4 Free Software Foundation, Inc. 5 5 Written by Cygnus Support. 6 6 7 This file is part of BFD, the Binary File Descriptor library.8 9 This program is free software; you can redistribute it and/or modify10 it under the terms of the GNU General Public License as published by11 the Free Software Foundation; either version 2 of the License, or12 (at your option) any later version.13 14 This program is distributed in the hope that it will be useful,15 but WITHOUT ANY WARRANTY; without even the implied warranty of16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the17 GNU General Public License for more details.18 19 You should have received a copy of the GNU General Public License20 along with this program; if not, write to the Free Software21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */7 This file is part of BFD, the Binary File Descriptor library. 8 9 This program is free software; you can redistribute it and/or modify 10 it under the terms of the GNU General Public License as published by 11 the Free Software Foundation; either version 2 of the License, or 12 (at your option) any later version. 13 14 This program is distributed in the hope that it will be useful, 15 but WITHOUT ANY WARRANTY; without even the implied warranty of 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 GNU General Public License for more details. 18 19 You should have received a copy of the GNU General Public License 20 along with this program; if not, write to the Free Software 21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 22 22 23 23 #ifndef LIBAOUT_H … … 30 30 #include "bfdlink.h" 31 31 32 /* Macros for accessing components in an aout header. Saves cluttering 33 the source with (bfd_vma) and (bfd_byte *) casts. */ 34 35 #define H_PUT_64(abfd, val, where) \ 36 bfd_h_put_64 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) 37 38 #define H_PUT_32(abfd, val, where) \ 39 bfd_h_put_32 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) 40 41 #define H_PUT_16(abfd, val, where) \ 42 bfd_h_put_16 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) 43 44 #define H_PUT_8 bfd_h_put_8 45 46 #define H_PUT_S64(abfd, val, where) \ 47 bfd_h_put_signed_64 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) 48 49 #define H_PUT_S32(abfd, val, where) \ 50 bfd_h_put_signed_32 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) 51 52 #define H_PUT_S16(abfd, val, where) \ 53 bfd_h_put_signed_16 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) 54 55 #define H_PUT_S8 bfd_h_put_signed_8 56 57 #define H_GET_64(abfd, where) \ 58 bfd_h_get_64 ((abfd), (bfd_byte *) (where)) 59 60 #define H_GET_32(abfd, where) \ 61 bfd_h_get_32 ((abfd), (bfd_byte *) (where)) 62 63 #define H_GET_16(abfd, where) \ 64 bfd_h_get_16 ((abfd), (bfd_byte *) (where)) 65 66 #define H_GET_8 bfd_h_get_8 67 68 #define H_GET_S64(abfd, where) \ 69 bfd_h_get_signed_64 ((abfd), (bfd_byte *) (where)) 70 71 #define H_GET_S32(abfd, where) \ 72 bfd_h_get_signed_32 ((abfd), (bfd_byte *) (where)) 73 74 #define H_GET_S16(abfd, where) \ 75 bfd_h_get_signed_16 ((abfd), (bfd_byte *) (where)) 76 77 #define H_GET_S8 bfd_h_get_signed_8 78 32 79 /* Parameterize the a.out code based on whether it is being built 33 80 for a 32-bit architecture or a 64-bit architecture. */ 81 /* Do not "beautify" the CONCAT* macro args. Traditional C will not 82 remove whitespace added here, and thus will fail to concatenate 83 the tokens. */ 34 84 #if ARCH_SIZE==64 35 #define GET_WORD bfd_h_get_64 36 #define GET_SWORD bfd_h_get_signed_64 37 #define PUT_WORD bfd_h_put_64 85 #define GET_WORD H_GET_64 86 #define GET_SWORD H_GET_S64 87 #define GET_MAGIC H_GET_32 88 #define PUT_WORD H_PUT_64 89 #define PUT_MAGIC H_PUT_32 38 90 #ifndef NAME 39 #define NAME(x,y) C AT3(x,_64_,y)40 #endif 41 #define JNAME(x) C AT(x,_64)91 #define NAME(x,y) CONCAT3 (x,_64_,y) 92 #endif 93 #define JNAME(x) CONCAT2 (x,_64) 42 94 #define BYTES_IN_WORD 8 95 #else 96 #if ARCH_SIZE==16 97 #define GET_WORD H_GET_16 98 #define GET_SWORD H_GET_S16 99 #define GET_MAGIC H_GET_16 100 #define PUT_WORD H_PUT_16 101 #define PUT_MAGIC H_PUT_16 102 #ifndef NAME 103 #define NAME(x,y) CONCAT3 (x,_16_,y) 104 #endif 105 #define JNAME(x) CONCAT2 (x,_16) 106 #define BYTES_IN_WORD 2 43 107 #else /* ARCH_SIZE == 32 */ 44 #define GET_WORD bfd_h_get_32 45 #define GET_SWORD bfd_h_get_signed_32 46 #define PUT_WORD bfd_h_put_32 108 #define GET_WORD H_GET_32 109 #define GET_SWORD H_GET_S32 110 #define GET_MAGIC H_GET_32 111 #define PUT_WORD H_PUT_32 112 #define PUT_MAGIC H_PUT_32 47 113 #ifndef NAME 48 #define NAME(x,y) C AT3(x,_32_,y)49 #endif 50 #define JNAME(x) C AT(x,_32)114 #define NAME(x,y) CONCAT3 (x,_32_,y) 115 #endif 116 #define JNAME(x) CONCAT2 (x,_32) 51 117 #define BYTES_IN_WORD 4 52 118 #endif /* ARCH_SIZE==32 */ 119 #endif /* ARCH_SIZE==64 */ 53 120 54 121 /* Declare at file level, since used in parameter lists, which have … … 66 133 struct bfd_link_hash_entry root; 67 134 /* Whether this symbol has been written out. */ 68 b oolean written;135 bfd_boolean written; 69 136 /* Symbol index in output file. */ 70 137 int indx; … … 89 156 (bfd_link_hash_traverse \ 90 157 (&(table)->root, \ 91 (b oolean (*) PARAMS ((struct bfd_link_hash_entry *, PTR))) (func),\158 (bfd_boolean (*) PARAMS ((struct bfd_link_hash_entry *, PTR))) (func), \ 92 159 (info))) 93 160 … … 129 196 /* Callback for setting the page and segment sizes, if they can't be 130 197 trivially determined from the architecture. */ 131 boolean (*set_sizes) PARAMS ((bfd *)); 198 bfd_boolean (*set_sizes) 199 PARAMS ((bfd *)); 132 200 133 201 /* zmagic files only. For go32, the length of the exec header contributes … … 138 206 /* Callback from the add symbols phase of the linker code to handle 139 207 a dynamic object. */ 140 b oolean (*add_dynamic_symbols) PARAMS ((bfd *, struct bfd_link_info *,141 142 208 bfd_boolean (*add_dynamic_symbols) 209 PARAMS ((bfd *, struct bfd_link_info *, struct external_nlist **, 210 bfd_size_type *, char **)); 143 211 144 212 /* Callback from the add symbols phase of the linker code to handle 145 213 adding a single symbol to the global linker hash table. */ 146 boolean (*add_one_symbol) PARAMS ((struct bfd_link_info *, bfd *, 147 const char *, flagword, asection *, 148 bfd_vma, const char *, boolean, 149 boolean, 150 struct bfd_link_hash_entry **)); 214 bfd_boolean (*add_one_symbol) 215 PARAMS ((struct bfd_link_info *, bfd *, const char *, flagword, 216 asection *, bfd_vma, const char *, bfd_boolean, bfd_boolean, 217 struct bfd_link_hash_entry **)); 151 218 152 219 /* Called to handle linking a dynamic object. */ 153 boolean (*link_dynamic_object) PARAMS ((struct bfd_link_info *, bfd *)); 220 bfd_boolean (*link_dynamic_object) 221 PARAMS ((struct bfd_link_info *, bfd *)); 154 222 155 223 /* Called for each global symbol being written out by the linker. 156 224 This should write out the dynamic symbol information. */ 157 b oolean (*write_dynamic_symbol) PARAMS ((bfd *, struct bfd_link_info *,158 225 bfd_boolean (*write_dynamic_symbol) 226 PARAMS ((bfd *, struct bfd_link_info *, struct aout_link_hash_entry *)); 159 227 160 228 /* If this callback is not NULL, the linker calls it for each reloc. 161 229 RELOC is a pointer to the unswapped reloc. If *SKIP is set to 162 true, the reloc will be skipped. *RELOCATION may be changed to230 TRUE, the reloc will be skipped. *RELOCATION may be changed to 163 231 change the effects of the relocation. */ 164 boolean (*check_dynamic_reloc) PARAMS ((struct bfd_link_info *info, 165 bfd *input_bfd, 166 asection *input_section, 167 struct aout_link_hash_entry *h, 168 PTR reloc, bfd_byte *contents, 169 boolean *skip, 170 bfd_vma *relocation)); 232 bfd_boolean (*check_dynamic_reloc) 233 PARAMS ((struct bfd_link_info *info, bfd *input_bfd, 234 asection *input_section, struct aout_link_hash_entry *h, 235 PTR reloc, bfd_byte *contents, bfd_boolean *skip, 236 bfd_vma *relocation)); 171 237 172 238 /* Called at the end of a link to finish up any dynamic linking 173 239 information. */ 174 boolean (*finish_dynamic_link) PARAMS ((bfd *, struct bfd_link_info *)); 240 bfd_boolean (*finish_dynamic_link) 241 PARAMS ((bfd *, struct bfd_link_info *)); 175 242 }; 176 243 #define aout_backend_info(abfd) \ 177 (( CONSTstruct aout_backend_data *)((abfd)->xvec->backend_data))244 ((const struct aout_backend_data *)((abfd)->xvec->backend_data)) 178 245 179 246 /* This is the layout in memory of a "struct exec" while we process it. … … 205 272 }; 206 273 207 /* Magic number is written 274 /* Magic number is written 208 275 < MSB > 209 276 3130292827262524232221201918171615141312111009080706050403020100 … … 221 288 M_68020 = 2, 222 289 M_SPARC = 3, 223 /* skip a bunch so we don't run into any of suns numbers*/224 /* make these up for the ns32k*/225 M_NS32032 = (64), 226 M_NS32532 = (64 + 5), 290 /* Skip a bunch so we don't run into any of SUN's numbers. */ 291 /* Make these up for the ns32k. */ 292 M_NS32032 = (64), /* ns32032 running ? */ 293 M_NS32532 = (64 + 5), /* ns32532 running mach */ 227 294 228 295 M_386 = 100, … … 241 308 M_ARM6_NETBSD = 143, /* NetBSD/arm32 binary */ 242 309 M_SPARCLET_1 = 147, /* 0x93, reserved */ 310 M_VAX4K_NETBSD = 150, /* NetBSD/vax 4K pages binary */ 243 311 M_MIPS1 = 151, /* MIPS R2000/R3000 binary */ 244 312 M_MIPS2 = 152, /* MIPS R4000/R6000 binary */ … … 279 347 #ifndef N_SET_DYNAMIC 280 348 # define N_SET_DYNAMIC(exec, dynamic) \ 281 ((exec).a_info = (dynamic) ? ( (exec).a_info | 0x80000000) : \349 ((exec).a_info = (dynamic) ? (long) ((exec).a_info | 0x80000000) : \ 282 350 ((exec).a_info & 0x7fffffff)) 283 351 #endif … … 314 382 struct internal_exec *hdr; /* exec file header */ 315 383 aout_symbol_type *symbols; /* symtab for input bfd */ 316 317 /* For ease, we do this */384 385 /* For ease, we do this. */ 318 386 asection *textsec; 319 387 asection *datasec; … … 325 393 file_ptr str_filepos; 326 394 327 /* Size of a relocation entry in external form */395 /* Size of a relocation entry in external form. */ 328 396 unsigned reloc_entry_size; 329 397 330 /* Size of a symbol table entry in external form */398 /* Size of a symbol table entry in external form. */ 331 399 unsigned symbol_entry_size; 332 400 333 /* Page size - needed for alignment of demand paged files. */401 /* Page size - needed for alignment of demand paged files. */ 334 402 unsigned long page_size; 335 403 336 /* Segment size - needed for alignment of demand paged files. */404 /* Segment size - needed for alignment of demand paged files. */ 337 405 unsigned long segment_size; 338 406 … … 344 412 unsigned vma_adjusted : 1; 345 413 346 /* used when a bfd supports several highly similar formats*/414 /* Used when a bfd supports several highly similar formats. */ 347 415 enum 348 416 { … … 409 477 410 478 /* We take the address of the first element of an asymbol to ensure that the 411 macro is only ever applied to an asymbol */479 macro is only ever applied to an asymbol. */ 412 480 #define aout_symbol(asymbol) ((aout_symbol_type *)(&(asymbol)->the_bfd)) 413 481 … … 427 495 ((s)->used_by_bfd = (PTR)&(v)->relocs) 428 496 429 /* Prototype declarations for functions defined in aoutx.h */ 430 431 boolean 432 NAME(aout,squirt_out_relocs) PARAMS ((bfd *abfd, asection *section)); 433 434 boolean 435 NAME(aout,make_sections) PARAMS ((bfd *)); 436 437 const bfd_target * 438 NAME(aout,some_aout_object_p) PARAMS ((bfd *abfd, 439 struct internal_exec *execp, 440 const bfd_target *(*callback)(bfd *))); 441 442 boolean 443 NAME(aout,mkobject) PARAMS ((bfd *abfd)); 444 445 enum machine_type 446 NAME(aout,machine_type) PARAMS ((enum bfd_architecture arch, 447 unsigned long machine, 448 boolean *unknown)); 449 450 boolean 451 NAME(aout,set_arch_mach) PARAMS ((bfd *abfd, enum bfd_architecture arch, 452 unsigned long machine)); 453 454 boolean 455 NAME(aout,new_section_hook) PARAMS ((bfd *abfd, asection *newsect)); 456 457 boolean 458 NAME(aout,set_section_contents) PARAMS ((bfd *abfd, sec_ptr section, 459 PTR location, file_ptr offset, bfd_size_type count)); 460 461 asymbol * 462 NAME(aout,make_empty_symbol) PARAMS ((bfd *abfd)); 463 464 boolean 465 NAME(aout,translate_symbol_table) PARAMS ((bfd *, aout_symbol_type *, 466 struct external_nlist *, 467 bfd_size_type, char *, 468 bfd_size_type, 469 boolean dynamic)); 470 471 boolean 472 NAME(aout,slurp_symbol_table) PARAMS ((bfd *abfd)); 473 474 boolean 475 NAME(aout,write_syms) PARAMS ((bfd *abfd)); 476 477 void 478 NAME(aout,reclaim_symbol_table) PARAMS ((bfd *abfd)); 479 480 long 481 NAME(aout,get_symtab_upper_bound) PARAMS ((bfd *abfd)); 482 483 long 484 NAME(aout,get_symtab) PARAMS ((bfd *abfd, asymbol **location)); 485 486 void 487 NAME(aout,swap_ext_reloc_in) PARAMS ((bfd *, struct reloc_ext_external *, 488 arelent *, asymbol **, bfd_size_type)); 489 void 490 NAME(aout,swap_std_reloc_in) PARAMS ((bfd *, struct reloc_std_external *, 491 arelent *, asymbol **, bfd_size_type)); 492 493 reloc_howto_type * 494 NAME(aout,reloc_type_lookup) PARAMS ((bfd *abfd, 495 bfd_reloc_code_real_type code)); 496 497 boolean 498 NAME(aout,slurp_reloc_table) PARAMS ((bfd *abfd, sec_ptr asect, 499 asymbol **symbols)); 500 501 long 502 NAME(aout,canonicalize_reloc) PARAMS ((bfd *abfd, sec_ptr section, 503 arelent **relptr, asymbol **symbols)); 504 505 long 506 NAME(aout,get_reloc_upper_bound) PARAMS ((bfd *abfd, sec_ptr asect)); 507 508 void 509 NAME(aout,reclaim_reloc) PARAMS ((bfd *ignore_abfd, sec_ptr ignore)); 510 511 alent * 512 NAME(aout,get_lineno) PARAMS ((bfd *ignore_abfd, asymbol *ignore_symbol)); 513 514 void 515 NAME(aout,print_symbol) PARAMS ((bfd *ignore_abfd, PTR file, 516 asymbol *symbol, bfd_print_symbol_type how)); 517 518 void 519 NAME(aout,get_symbol_info) PARAMS ((bfd *ignore_abfd, 520 asymbol *symbol, symbol_info *ret)); 521 522 boolean 523 NAME(aout,find_nearest_line) PARAMS ((bfd *abfd, asection *section, 524 asymbol **symbols, bfd_vma offset, CONST char **filename_ptr, 525 CONST char **functionname_ptr, unsigned int *line_ptr)); 526 527 long 528 NAME(aout,read_minisymbols) PARAMS ((bfd *, boolean, PTR *, unsigned int *)); 529 530 asymbol * 531 NAME(aout,minisymbol_to_symbol) PARAMS ((bfd *, boolean, const PTR, 532 asymbol *)); 533 534 int 535 NAME(aout,sizeof_headers) PARAMS ((bfd *abfd, boolean exec)); 536 537 boolean 538 NAME(aout,adjust_sizes_and_vmas) PARAMS ((bfd *abfd, 539 bfd_size_type *text_size, file_ptr *text_end)); 540 541 void 542 NAME(aout,swap_exec_header_in) PARAMS ((bfd *abfd, 543 struct external_exec *raw_bytes, struct internal_exec *execp)); 544 545 void 546 NAME(aout,swap_exec_header_out) PARAMS ((bfd *abfd, 547 struct internal_exec *execp, struct external_exec *raw_bytes)); 548 549 struct bfd_hash_entry * 550 NAME(aout,link_hash_newfunc) 497 /* Prototype declarations for functions defined in aoutx.h. */ 498 499 extern bfd_boolean NAME(aout,squirt_out_relocs) 500 PARAMS ((bfd *, asection *)); 501 502 extern bfd_boolean NAME(aout,make_sections) 503 PARAMS ((bfd *)); 504 505 extern const bfd_target * NAME(aout,some_aout_object_p) 506 PARAMS ((bfd *, struct internal_exec *, const bfd_target *(*) (bfd *))); 507 508 extern bfd_boolean NAME(aout,mkobject) 509 PARAMS ((bfd *)); 510 511 extern enum machine_type NAME(aout,machine_type) 512 PARAMS ((enum bfd_architecture, unsigned long, bfd_boolean *)); 513 514 extern bfd_boolean NAME(aout,set_arch_mach) 515 PARAMS ((bfd *, enum bfd_architecture, unsigned long)); 516 517 extern bfd_boolean NAME(aout,new_section_hook) 518 PARAMS ((bfd *, asection *)); 519 520 extern bfd_boolean NAME(aout,set_section_contents) 521 PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type)); 522 523 extern asymbol * NAME(aout,make_empty_symbol) 524 PARAMS ((bfd *)); 525 526 extern bfd_boolean NAME(aout,translate_symbol_table) 527 PARAMS ((bfd *, aout_symbol_type *, struct external_nlist *, bfd_size_type, 528 char *, bfd_size_type, bfd_boolean)); 529 530 extern bfd_boolean NAME(aout,slurp_symbol_table) 531 PARAMS ((bfd *)); 532 533 extern bfd_boolean NAME(aout,write_syms) 534 PARAMS ((bfd *)); 535 536 extern void NAME(aout,reclaim_symbol_table) 537 PARAMS ((bfd *)); 538 539 extern long NAME(aout,get_symtab_upper_bound) 540 PARAMS ((bfd *)); 541 542 extern long NAME(aout,get_symtab) 543 PARAMS ((bfd *, asymbol **)); 544 545 extern void NAME(aout,swap_ext_reloc_in) 546 PARAMS ((bfd *, struct reloc_ext_external *, arelent *, asymbol **, 547 bfd_size_type)); 548 extern void NAME(aout,swap_std_reloc_in) 549 PARAMS ((bfd *, struct reloc_std_external *, arelent *, asymbol **, 550 bfd_size_type)); 551 552 extern reloc_howto_type * NAME(aout,reloc_type_lookup) 553 PARAMS ((bfd *, bfd_reloc_code_real_type)); 554 555 extern bfd_boolean NAME(aout,slurp_reloc_table) 556 PARAMS ((bfd *, sec_ptr, asymbol **)); 557 558 extern long NAME(aout,canonicalize_reloc) 559 PARAMS ((bfd *, sec_ptr, arelent **, asymbol **)); 560 561 extern long NAME(aout,get_reloc_upper_bound) 562 PARAMS ((bfd *, sec_ptr)); 563 564 extern void NAME(aout,reclaim_reloc) 565 PARAMS ((bfd *, sec_ptr)); 566 567 extern alent * NAME(aout,get_lineno) 568 PARAMS ((bfd *, asymbol *)); 569 570 extern void NAME(aout,print_symbol) 571 PARAMS ((bfd *, PTR, asymbol *, bfd_print_symbol_type)); 572 573 extern void NAME(aout,get_symbol_info) 574 PARAMS ((bfd *, asymbol *, symbol_info *)); 575 576 extern bfd_boolean NAME(aout,find_nearest_line) 577 PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **, 578 const char **, unsigned int *)); 579 580 extern long NAME(aout,read_minisymbols) 581 PARAMS ((bfd *, bfd_boolean, PTR *, unsigned int *)); 582 583 extern asymbol * NAME(aout,minisymbol_to_symbol) 584 PARAMS ((bfd *, bfd_boolean, const PTR, asymbol *)); 585 586 extern int NAME(aout,sizeof_headers) 587 PARAMS ((bfd *, bfd_boolean)); 588 589 extern bfd_boolean NAME(aout,adjust_sizes_and_vmas) 590 PARAMS ((bfd *, bfd_size_type *, file_ptr *)); 591 592 extern void NAME(aout,swap_exec_header_in) 593 PARAMS ((bfd *, struct external_exec *, struct internal_exec *)); 594 595 extern void NAME(aout,swap_exec_header_out) 596 PARAMS ((bfd *, struct internal_exec *, struct external_exec *)); 597 598 extern struct bfd_hash_entry * NAME(aout,link_hash_newfunc) 551 599 PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); 552 600 553 boolean 554 NAME(aout,link_hash_table_init) 555 PARAMS ((struct aout_link_hash_table *, bfd*,556 struct bfd_hash_entry *(*) (struct bfd_hash_entry*,557 struct bfd_hash_table *,558 const char *))); 559 560 struct bfd_link_hash_table * 561 NAME(aout,link_hash_table_create) PARAMS ((bfd *)); 562 563 boolean 564 NAME(aout,link_add_symbols) PARAMS ((bfd *, struct bfd_link_info *)); 565 566 boolean 567 NAME(aout,final_link) PARAMS ((bfd *, struct bfd_link_info *, 568 void (*) (bfd *, file_ptr *, file_ptr *, 569 file_ptr *))); 570 571 boolean 572 NAME(aout,bfd_free_cached_info) PARAMS ((bfd *)); 573 574 /* A.out uses the generic versions of these routines... */ 601 extern bfd_boolean NAME(aout,link_hash_table_init) 602 PARAMS ((struct aout_link_hash_table *, bfd *, 603 struct bfd_hash_entry *(*) (struct bfd_hash_entry *, 604 struct bfd_hash_table *, 605 const char *))); 606 607 extern struct bfd_link_hash_table * NAME(aout,link_hash_table_create) 608 PARAMS ((bfd *)); 609 610 extern bfd_boolean NAME(aout,link_add_symbols) 611 PARAMS ((bfd *, struct bfd_link_info *)); 612 613 extern bfd_boolean NAME(aout,final_link) 614 PARAMS ((bfd *, struct bfd_link_info *, 615 void (*) (bfd *, file_ptr *, file_ptr *, file_ptr *))); 616 617 extern bfd_boolean NAME(aout,bfd_free_cached_info) 618 PARAMS ((bfd *)); 619 620 /* A.out uses the generic versions of these routines... */ 621 622 #define aout_16_get_section_contents _bfd_generic_get_section_contents 575 623 576 624 #define aout_32_get_section_contents _bfd_generic_get_section_contents … … 602 650 NAME(aout,swap_exec_header_out) (abfd, execp, &exec_bytes); \ 603 651 \ 604 if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0 ) return false;\605 if (bfd_write ((PTR) &exec_bytes, 1, EXEC_BYTES_SIZE, abfd)\606 != EXEC_BYTES_SIZE)\607 return false; \608 /* Now write out reloc info, followed by syms and strings */ \652 if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0 \ 653 || bfd_bwrite ((PTR) &exec_bytes, (bfd_size_type) EXEC_BYTES_SIZE, \ 654 abfd) != EXEC_BYTES_SIZE) \ 655 return FALSE; \ 656 /* Now write out reloc info, followed by syms and strings. */ \ 609 657 \ 610 658 if (bfd_get_outsymbols (abfd) != (asymbol **) NULL \ 611 659 && bfd_get_symcount (abfd) != 0) \ 612 660 { \ 613 if (bfd_seek (abfd, (file_ptr) (N_SYMOFF(*execp)), SEEK_SET) != 0)\614 return false; \661 if (bfd_seek (abfd, (file_ptr) (N_SYMOFF(*execp)), SEEK_SET) != 0)\ 662 return FALSE; \ 615 663 \ 616 if (! NAME(aout,write_syms)(abfd)) return false; \ 664 if (! NAME(aout,write_syms) (abfd)) \ 665 return FALSE; \ 617 666 } \ 618 667 \ 619 if (bfd_seek (abfd, (file_ptr) (N_TRELOFF(*execp)), SEEK_SET) != 0)\620 return false; \668 if (bfd_seek (abfd, (file_ptr) (N_TRELOFF(*execp)), SEEK_SET) != 0) \ 669 return FALSE; \ 621 670 if (!NAME(aout,squirt_out_relocs) (abfd, obj_textsec (abfd))) \ 622 return false; \671 return FALSE; \ 623 672 \ 624 if (bfd_seek (abfd, (file_ptr)(N_DRELOFF(*execp)), SEEK_SET) != 0) \ 625 return false; \ 626 if (!NAME(aout,squirt_out_relocs)(abfd, obj_datasec (abfd))) \ 627 return false; \ 628 } 629 #endif 673 if (bfd_seek (abfd, (file_ptr) (N_DRELOFF(*execp)), SEEK_SET) != 0) \ 674 return FALSE; \ 675 if (!NAME(aout,squirt_out_relocs) (abfd, obj_datasec (abfd))) \ 676 return FALSE; \ 677 } 678 #endif 679 680 /* Test if a read-only section can be merged with .text. This is 681 possible if: 682 683 1. Section has file contents and is read-only. 684 2. The VMA of the section is after the end of .text and before 685 the start of .data. 686 3. The image is demand-pageable (otherwise, a_text in the header 687 will not reflect the gap between .text and .data). */ 688 689 #define aout_section_merge_with_text_p(abfd, sec) \ 690 (((sec)->flags & (SEC_HAS_CONTENTS | SEC_READONLY)) == \ 691 (SEC_HAS_CONTENTS | SEC_READONLY) \ 692 && obj_textsec (abfd) != NULL \ 693 && obj_datasec (abfd) != NULL \ 694 && (sec)->vma >= (obj_textsec (abfd)->vma + \ 695 obj_textsec (abfd)->_cooked_size) \ 696 && ((sec)->vma + (sec)->_cooked_size) <= obj_datasec (abfd)->vma \ 697 && ((abfd)->flags & D_PAGED) != 0) 630 698 631 699 #endif /* ! defined (LIBAOUT_H) */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/binutils/bfd/syms.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r617 r618 1 1 /* Generic symbol-table support for the BFD library. 2 2 Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 3 2000 3 2000, 2001, 2002, 2003 4 4 Free Software Foundation, Inc. 5 5 Written by Cygnus Support. 6 6 7 This file is part of BFD, the Binary File Descriptor library.8 9 This program is free software; you can redistribute it and/or modify10 it under the terms of the GNU General Public License as published by11 the Free Software Foundation; either version 2 of the License, or12 (at your option) any later version.13 14 This program is distributed in the hope that it will be useful,15 but WITHOUT ANY WARRANTY; without even the implied warranty of16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the17 GNU General Public License for more details.18 19 You should have received a copy of the GNU General Public License20 along with this program; if not, write to the Free Software21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */7 This file is part of BFD, the Binary File Descriptor library. 8 9 This program is free software; you can redistribute it and/or modify 10 it under the terms of the GNU General Public License as published by 11 the Free Software Foundation; either version 2 of the License, or 12 (at your option) any later version. 13 14 This program is distributed in the hope that it will be useful, 15 but WITHOUT ANY WARRANTY; without even the implied warranty of 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 GNU General Public License for more details. 18 19 You should have received a copy of the GNU General Public License 20 along with this program; if not, write to the Free Software 21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 22 22 23 23 /* … … 75 75 | FAIL 76 76 | 77 | if (storage_needed == 0) {78 | return;79 | }77 | if (storage_needed == 0) 78 | return; 79 | 80 80 | symbol_table = (asymbol **) xmalloc (storage_needed); 81 81 | ... … … 86 86 | FAIL 87 87 | 88 | for (i = 0; i < number_of_symbols; i++) { 89 | process_symbol (symbol_table[i]); 90 | } 88 | for (i = 0; i < number_of_symbols; i++) 89 | process_symbol (symbol_table[i]); 91 90 92 91 All storage for the symbols themselves is in an objalloc … … 109 108 110 109 | #include "bfd.h" 111 | main()110 | int main (void) 112 111 | { 113 112 | bfd *abfd; … … 115 114 | asymbol *new; 116 115 | 117 | abfd = bfd_openw ("foo","a.out-sunos-big");118 | bfd_set_format (abfd, bfd_object);119 | new = bfd_make_empty_symbol (abfd);116 | abfd = bfd_openw ("foo","a.out-sunos-big"); 117 | bfd_set_format (abfd, bfd_object); 118 | new = bfd_make_empty_symbol (abfd); 120 119 | new->name = "dummy_symbol"; 121 | new->section = bfd_make_section_old_way (abfd, ".text");120 | new->section = bfd_make_section_old_way (abfd, ".text"); 122 121 | new->flags = BSF_GLOBAL; 123 122 | new->value = 0x12345; … … 126 125 | ptrs[1] = (asymbol *)0; 127 126 | 128 | bfd_set_symtab(abfd, ptrs, 1); 129 | bfd_close(abfd); 127 | bfd_set_symtab (abfd, ptrs, 1); 128 | bfd_close (abfd); 129 | return 0; 130 130 | } 131 131 | … … 184 184 .typedef struct symbol_cache_entry 185 185 .{ 186 . {* A pointer to the BFD which owns the symbol. This information 187 . is necessary so that a back end can work out what additional 188 . information (invisible to the application writer) is carried 189 . with the symbol. 190 . 191 . This field is *almost* redundant, since you can use section->owner 192 . instead, except that some symbols point to the global sections 193 . bfd_{abs,com,und}_section. This could be fixed by making 194 . these globals be per-bfd (or per-target-flavor). FIXME. *} 195 . 196 . struct _bfd *the_bfd; {* Use bfd_asymbol_bfd(sym) to access this field. *} 197 . 198 . {* The text of the symbol. The name is left alone, and not copied; the 199 . application may not alter it. *} 200 . CONST char *name; 201 . 202 . {* The value of the symbol. This really should be a union of a 203 . numeric value with a pointer, since some flags indicate that 204 . a pointer to another symbol is stored here. *} 186 . {* A pointer to the BFD which owns the symbol. This information 187 . is necessary so that a back end can work out what additional 188 . information (invisible to the application writer) is carried 189 . with the symbol. 190 . 191 . This field is *almost* redundant, since you can use section->owner 192 . instead, except that some symbols point to the global sections 193 . bfd_{abs,com,und}_section. This could be fixed by making 194 . these globals be per-bfd (or per-target-flavor). FIXME. *} 195 . struct bfd *the_bfd; {* Use bfd_asymbol_bfd(sym) to access this field. *} 196 . 197 . {* The text of the symbol. The name is left alone, and not copied; the 198 . application may not alter it. *} 199 . const char *name; 200 . 201 . {* The value of the symbol. This really should be a union of a 202 . numeric value with a pointer, since some flags indicate that 203 . a pointer to another symbol is stored here. *} 205 204 . symvalue value; 206 205 . 207 . {* Attributes of a symbol: *} 208 . 206 . {* Attributes of a symbol. *} 209 207 .#define BSF_NO_FLAGS 0x00 210 208 . 211 . 212 . is the offset into the section of the data.*}209 . {* The symbol has local scope; <<static>> in <<C>>. The value 210 . is the offset into the section of the data. *} 213 211 .#define BSF_LOCAL 0x01 214 212 . 215 . 216 . value is the offset into the section of the data.*}213 . {* The symbol has global scope; initialized data in <<C>>. The 214 . value is the offset into the section of the data. *} 217 215 .#define BSF_GLOBAL 0x02 218 216 . 219 . 220 . the offset into the section of the data.*}221 .#define BSF_EXPORT BSF_GLOBAL {* no real difference*}222 . 223 . 224 . 225 . <<BSF_GLOBAL>>*}226 . 227 . 228 . 217 . {* The symbol has global scope and is exported. The value is 218 . the offset into the section of the data. *} 219 .#define BSF_EXPORT BSF_GLOBAL {* No real difference. *} 220 . 221 . {* A normal C symbol would be one of: 222 . <<BSF_LOCAL>>, <<BSF_FORT_COMM>>, <<BSF_UNDEFINED>> or 223 . <<BSF_GLOBAL>>. *} 224 . 225 . {* The symbol is a debugging record. The value has an arbitary 226 . meaning, unless BSF_DEBUGGING_RELOC is also set. *} 229 227 .#define BSF_DEBUGGING 0x08 230 228 . 231 . 232 . 229 . {* The symbol denotes a function entry point. Used in ELF, 230 . perhaps others someday. *} 233 231 .#define BSF_FUNCTION 0x10 234 232 . 235 . {* Used by the linker.*}233 . {* Used by the linker. *} 236 234 .#define BSF_KEEP 0x20 237 235 .#define BSF_KEEP_G 0x40 238 236 . 239 . 240 . 237 . {* A weak global symbol, overridable without warnings by 238 . a regular global symbol of the same name. *} 241 239 .#define BSF_WEAK 0x80 242 240 . 243 . 244 . 241 . {* This symbol was created to point to a section, e.g. ELF's 242 . STT_SECTION symbols. *} 245 243 .#define BSF_SECTION_SYM 0x100 246 244 . 247 . 248 . allocated.*}245 . {* The symbol used to be a common symbol, but now it is 246 . allocated. *} 249 247 .#define BSF_OLD_COMMON 0x200 250 248 . 251 . {* The default value for common data.*}249 . {* The default value for common data. *} 252 250 .#define BFD_FORT_COMM_DEFAULT_VALUE 0 253 251 . 254 . {* In some files the type of a symbol sometimes alters its 255 . location in an output file - ie in coff a <<ISFCN>> symbol 256 . which is also <<C_EXT>> symbol appears where it was 257 . declared and not at the end of a section. This bit is set 258 . by the target BFD part to convey this information. *} 259 . 252 . {* In some files the type of a symbol sometimes alters its 253 . location in an output file - ie in coff a <<ISFCN>> symbol 254 . which is also <<C_EXT>> symbol appears where it was 255 . declared and not at the end of a section. This bit is set 256 . by the target BFD part to convey this information. *} 260 257 .#define BSF_NOT_AT_END 0x400 261 258 . 262 . {* Signal that the symbol is the label of constructor section.*}259 . {* Signal that the symbol is the label of constructor section. *} 263 260 .#define BSF_CONSTRUCTOR 0x800 264 261 . 265 . 266 . 267 . 268 . symbol, a warning is issued by the linker.*}262 . {* Signal that the symbol is a warning symbol. The name is a 263 . warning. The name of the next symbol is the one to warn about; 264 . if a reference is made to a symbol with the same name as the next 265 . symbol, a warning is issued by the linker. *} 269 266 .#define BSF_WARNING 0x1000 270 267 . 271 . 272 . pointer to the symbol with the same name as the next symbol.*}268 . {* Signal that the symbol is indirect. This symbol is an indirect 269 . pointer to the symbol with the same name as the next symbol. *} 273 270 .#define BSF_INDIRECT 0x2000 274 271 . 275 . 276 . 272 . {* BSF_FILE marks symbols that contain a file name. This is used 273 . for ELF STT_FILE symbols. *} 277 274 .#define BSF_FILE 0x4000 278 275 . 279 . 276 . {* Symbol is from dynamic linking information. *} 280 277 .#define BSF_DYNAMIC 0x8000 281 278 . 282 . 283 . 279 . {* The symbol denotes a data object. Used in ELF, and perhaps 280 . others someday. *} 284 281 .#define BSF_OBJECT 0x10000 285 282 . 286 . 287 . 288 . 283 . {* This symbol is a debugging symbol. The value is the offset 284 . into the section of the data. BSF_DEBUGGING should be set 285 . as well. *} 289 286 .#define BSF_DEBUGGING_RELOC 0x20000 290 287 . 291 . {* Symbol is an emx import reference. *} 288 . {* This symbol is thread local. Used in ELF. *} 289 .#define BSF_THREAD_LOCAL 0x40000 290 . 291 . {* Symbol is an emx import reference. *} 292 292 .#define BSF_EMX_IMPORT1 0x20000000 293 293 . 294 . 294 . {* Symbol is an emx import definition. *} 295 295 .#define BSF_EMX_IMPORT2 0x40000000 296 296 . 297 297 . flagword flags; 298 298 . 299 . 300 . 301 . 299 . {* A pointer to the section to which this symbol is 300 . relative. This will always be non NULL, there are special 301 . sections for undefined and absolute symbols. *} 302 302 . struct sec *section; 303 303 . 304 . 304 . {* Back end special data. *} 305 305 . union 306 306 . { 307 307 . PTR p; 308 308 . bfd_vma i; 309 . } udata; 310 . 311 .} asymbol; 309 . } 310 . udata; 311 .} 312 .asymbol; 313 . 312 314 */ 313 315 … … 315 317 #include "sysdep.h" 316 318 #include "libbfd.h" 319 #include "safe-ctype.h" 317 320 #include "bfdlink.h" 318 321 #include "aout/stab_gnu.h" 319 322 320 323 static char coff_section_type PARAMS ((const char *)); 324 static char decode_section_type PARAMS ((const struct sec *)); 325 static int cmpindexentry PARAMS ((const PTR, const PTR)); 321 326 322 327 /* … … 340 345 .#define bfd_get_symtab_upper_bound(abfd) \ 341 346 . BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) 342 347 . 343 348 */ 344 349 … … 348 353 349 354 SYNOPSIS 350 b oolean bfd_is_local_label(bfd *abfd, asymbol *sym);355 bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym); 351 356 352 357 DESCRIPTION 353 Return trueif the given symbol @var{sym} in the BFD @var{abfd} is354 a compiler generated local label, else return false.355 */ 356 357 b oolean358 Return TRUE if the given symbol @var{sym} in the BFD @var{abfd} is 359 a compiler generated local label, else return FALSE. 360 */ 361 362 bfd_boolean 358 363 bfd_is_local_label (abfd, sym) 359 364 bfd *abfd; 360 365 asymbol *sym; 361 366 { 362 if ((sym->flags & (BSF_GLOBAL | BSF_WEAK)) != 0) 363 return false; 367 /* The BSF_SECTION_SYM check is needed for IA-64, where every label that 368 starts with '.' is local. This would accidentally catch section names 369 if we didn't reject them here. */ 370 if ((sym->flags & (BSF_GLOBAL | BSF_WEAK | BSF_SECTION_SYM)) != 0) 371 return FALSE; 364 372 if (sym->name == NULL) 365 return false;373 return FALSE; 366 374 return bfd_is_local_label_name (abfd, sym->name); 367 375 } … … 372 380 373 381 SYNOPSIS 374 b oolean bfd_is_local_label_name(bfd *abfd, const char *name);382 bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name); 375 383 376 384 DESCRIPTION 377 Return trueif a symbol with the name @var{name} in the BFD385 Return TRUE if a symbol with the name @var{name} in the BFD 378 386 @var{abfd} is a compiler generated local label, else return 379 false. This just checks whether the name has the form of a387 FALSE. This just checks whether the name has the form of a 380 388 local label. 381 389 382 390 .#define bfd_is_local_label_name(abfd, name) \ 383 391 . BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) 392 . 384 393 */ 385 394 … … 398 407 . BFD_SEND (abfd, _bfd_canonicalize_symtab,\ 399 408 . (abfd, location)) 400 409 . 401 410 */ 402 411 … … 406 415 407 416 SYNOPSIS 408 b oolean bfd_set_symtab (bfd *abfd, asymbol **location, unsigned int count);417 bfd_boolean bfd_set_symtab (bfd *abfd, asymbol **location, unsigned int count); 409 418 410 419 DESCRIPTION … … 414 423 */ 415 424 416 b oolean425 bfd_boolean 417 426 bfd_set_symtab (abfd, location, symcount) 418 427 bfd *abfd; … … 423 432 { 424 433 bfd_set_error (bfd_error_invalid_operation); 425 return false;434 return FALSE; 426 435 } 427 436 428 437 bfd_get_outsymbols (abfd) = location; 429 438 bfd_get_symcount (abfd) = symcount; 430 return true;439 return TRUE; 431 440 } 432 441 … … 436 445 437 446 SYNOPSIS 438 void bfd_print_symbol_vandf (PTR file, asymbol *symbol);447 void bfd_print_symbol_vandf (bfd *abfd, PTR file, asymbol *symbol); 439 448 440 449 DESCRIPTION … … 443 452 */ 444 453 void 445 bfd_print_symbol_vandf (arg, symbol) 454 bfd_print_symbol_vandf (abfd, arg, symbol) 455 bfd *abfd; 446 456 PTR arg; 447 457 asymbol *symbol; 448 458 { 449 459 FILE *file = (FILE *) arg; 460 450 461 flagword type = symbol->flags; 462 451 463 if (symbol->section != (asection *) NULL) 452 { 453 fprintf_vma (file, symbol->value + symbol->section->vma); 454 } 464 bfd_fprintf_vma (abfd, file, 465 symbol->value + symbol->section->vma); 455 466 else 456 { 457 fprintf_vma (file, symbol->value); 458 } 467 bfd_fprintf_vma (abfd, file, symbol->value); 459 468 460 469 /* This presumes that a symbol can not be both BSF_DEBUGGING and … … 496 505 .#define bfd_make_empty_symbol(abfd) \ 497 506 . BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) 498 */ 507 . 508 */ 509 510 /* 511 FUNCTION 512 _bfd_generic_make_empty_symbol 513 514 SYNOPSIS 515 asymbol * _bfd_generic_make_empty_symbol (bfd *); 516 517 DESCRIPTION 518 Create a new <<asymbol>> structure for the BFD @var{abfd} 519 and return a pointer to it. Used by core file routines, 520 binary back-end and anywhere else where no private info 521 is needed. 522 */ 523 524 asymbol * 525 _bfd_generic_make_empty_symbol (abfd) 526 bfd *abfd; 527 { 528 bfd_size_type amt = sizeof (asymbol); 529 asymbol *new = (asymbol *) bfd_zalloc (abfd, amt); 530 if (new) 531 new->the_bfd = abfd; 532 return new; 533 } 499 534 500 535 /* … … 509 544 .#define bfd_make_debug_symbol(abfd,ptr,size) \ 510 545 . BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) 546 . 511 547 */ 512 548 513 549 struct section_to_type 514 550 { 515 CONSTchar *section;551 const char *section; 516 552 char type; 517 553 }; … … 520 556 This table is probably incomplete. It is sorted for convenience of 521 557 adding entries. Since it is so short, a linear search is used. */ 522 static CONST struct section_to_type stt[] = 523 { 558 static const struct section_to_type stt[] = 559 { 560 {".bss", 'b'}, 561 {"code", 't'}, /* MRI .text */ 562 {".data", 'd'}, 524 563 {"*DEBUG*", 'N'}, 525 {".bss", 'b'}, 526 {"zerovars", 'b'}, /* MRI .bss */ 527 {".data", 'd'}, 528 {"vars", 'd'}, /* MRI .data */ 564 {".debug", 'N'}, /* MSVC's .debug (non-standard debug syms) */ 565 {".drectve", 'i'}, /* MSVC's .drective section */ 566 {".edata", 'e'}, /* MSVC's .edata (export) section */ 567 {".fini", 't'}, /* ELF fini section */ 568 {".idata", 'i'}, /* MSVC's .idata (import) section */ 569 {".init", 't'}, /* ELF init section */ 570 {".pdata", 'p'}, /* MSVC's .pdata (stack unwind) section */ 529 571 {".rdata", 'r'}, /* Read only data. */ 530 572 {".rodata", 'r'}, /* Read only data. */ … … 533 575 {".sdata", 'g'}, /* Small initialized data. */ 534 576 {".text", 't'}, 535 {"code", 't'}, /* MRI .text */ 536 {".drectve", 'i'}, /* MSVC's .drective section */ 537 {".idata", 'i'}, /* MSVC's .idata (import) section */ 538 {".edata", 'e'}, /* MSVC's .edata (export) section */ 539 {".pdata", 'p'}, /* MSVC's .pdata (stack unwind) section */ 540 {".debug", 'N'}, /* MSVC's .debug (non-standard debug syms) */ 577 {"vars", 'd'}, /* MRI .data */ 578 {"zerovars", 'b'}, /* MRI .bss */ 541 579 {0, 0} 542 580 }; … … 552 590 const char *s; 553 591 { 554 CONSTstruct section_to_type *t;592 const struct section_to_type *t; 555 593 556 594 for (t = &stt[0]; t->section; t++) … … 561 599 } 562 600 563 #ifndef islower 564 #define islower(c) ((c) >= 'a' && (c) <= 'z') 565 #endif 566 #ifndef toupper 567 #define toupper(c) (islower(c) ? ((c) & ~0x20) : (c)) 568 #endif 601 /* Return the single-character symbol type corresponding to section 602 SECTION, or '?' for an unknown section. This uses section flags to 603 identify sections. 604 605 FIXME These types are unhandled: c, i, e, p. If we handled these also, 606 we could perhaps obsolete coff_section_type. */ 607 608 static char 609 decode_section_type (section) 610 const struct sec *section; 611 { 612 if (section->flags & SEC_CODE) 613 return 't'; 614 if (section->flags & SEC_DATA) 615 { 616 if (section->flags & SEC_READONLY) 617 return 'r'; 618 else if (section->flags & SEC_SMALL_DATA) 619 return 'g'; 620 else 621 return 'd'; 622 } 623 if ((section->flags & SEC_HAS_CONTENTS) == 0) 624 { 625 if (section->flags & SEC_SMALL_DATA) 626 return 's'; 627 else 628 return 'b'; 629 } 630 if (section->flags & SEC_DEBUGGING) 631 return 'N'; 632 633 return '?'; 634 } 569 635 570 636 /* … … 577 643 578 644 SYNOPSIS 579 int bfd_decode_symclass (asymbol *symbol);645 int bfd_decode_symclass (asymbol *symbol); 580 646 */ 581 647 int … … 624 690 c = 'a'; 625 691 else if (symbol->section) 626 c = coff_section_type (symbol->section->name); 692 { 693 c = coff_section_type (symbol->section->name); 694 if (c == '?') 695 c = decode_section_type (symbol->section); 696 } 627 697 else 628 698 return '?'; 629 699 if (symbol->flags & BSF_GLOBAL) 630 c = toupper(c);700 c = TOUPPER (c); 631 701 return c; 632 702 … … 651 721 652 722 SYNOPSIS 653 b oolean bfd_is_undefined_symclass (int symclass);654 */ 655 656 b oolean723 bfd_boolean bfd_is_undefined_symclass (int symclass); 724 */ 725 726 bfd_boolean 657 727 bfd_is_undefined_symclass (symclass) 658 728 int symclass; … … 671 741 672 742 SYNOPSIS 673 void bfd_symbol_info (asymbol *symbol, symbol_info *ret);743 void bfd_symbol_info (asymbol *symbol, symbol_info *ret); 674 744 */ 675 745 … … 694 764 695 765 SYNOPSIS 696 b oolean bfd_copy_private_symbol_data(bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym);766 bfd_boolean bfd_copy_private_symbol_data (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym); 697 767 698 768 DESCRIPTION 699 769 Copy private symbol information from @var{isym} in the BFD 700 770 @var{ibfd} to the symbol @var{osym} in the BFD @var{obfd}. 701 Return << true>> on success, <<false>> on error. Possible error771 Return <<TRUE>> on success, <<FALSE>> on error. Possible error 702 772 returns are: 703 773 … … 708 778 . BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ 709 779 . (ibfd, isymbol, obfd, osymbol)) 710 780 . 711 781 */ 712 782 … … 718 788 _bfd_generic_read_minisymbols (abfd, dynamic, minisymsp, sizep) 719 789 bfd *abfd; 720 b oolean dynamic;790 bfd_boolean dynamic; 721 791 PTR *minisymsp; 722 792 unsigned int *sizep; … … 732 802 if (storage < 0) 733 803 goto error_return; 734 735 syms = (asymbol **) bfd_malloc ((size_t) storage); 804 if (storage == 0) 805 return 0; 806 807 syms = (asymbol **) bfd_malloc ((bfd_size_type) storage); 736 808 if (syms == NULL) 737 809 goto error_return; … … 749 821 750 822 error_return: 823 bfd_set_error (bfd_error_no_symbols); 751 824 if (syms != NULL) 752 825 free (syms); … … 758 831 we just return the asymbol the minisymbol points to. */ 759 832 760 /*ARGSUSED*/761 833 asymbol * 762 834 _bfd_generic_minisymbol_to_symbol (abfd, dynamic, minisym, sym) 763 835 bfd *abfd ATTRIBUTE_UNUSED; 764 b oolean dynamic ATTRIBUTE_UNUSED;836 bfd_boolean dynamic ATTRIBUTE_UNUSED; 765 837 const PTR minisym; 766 838 asymbol *sym ATTRIBUTE_UNUSED; … … 772 844 sections to find the source file and line closest to a desired 773 845 location. This is used by COFF and ELF targets. It sets *pfound 774 to trueif it finds some information. The *pinfo field is used to846 to TRUE if it finds some information. The *pinfo field is used to 775 847 pass cached information in and out of this routine; this first time 776 848 the routine is called for a BFD, *pinfo should be NULL. The value … … 844 916 }; 845 917 846 b oolean918 bfd_boolean 847 919 _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound, 848 920 pfilename, pfnname, pline, pinfo) … … 851 923 asection *section; 852 924 bfd_vma offset; 853 b oolean *pfound;925 bfd_boolean *pfound; 854 926 const char **pfilename; 855 927 const char **pfnname; … … 863 935 bfd_size_type stroff; 864 936 struct indexentry *indexentry; 865 char *directory_name, *file_name; 937 char *file_name; 938 char *directory_name; 866 939 int saw_fun; 867 868 *pfound = false; 940 bfd_boolean saw_line, saw_func; 941 942 *pfound = FALSE; 869 943 *pfilename = bfd_get_filename (abfd); 870 944 *pfnname = NULL; … … 897 971 { 898 972 /* No stabs debugging information. */ 899 return true;973 return TRUE; 900 974 } 901 975 … … 909 983 int i; 910 984 char *name; 911 char *file_name;912 char *directory_name;913 985 char *function_name; 914 915 info = (struct stab_find_info *) bfd_zalloc (abfd, sizeof *info); 986 bfd_size_type amt = sizeof *info; 987 988 info = (struct stab_find_info *) bfd_zalloc (abfd, amt); 916 989 if (info == NULL) 917 return false;990 return FALSE; 918 991 919 992 /* FIXME: When using the linker --split-by-file or … … 929 1002 can return quickly in the info != NULL case above. */ 930 1003 *pinfo = (PTR) info; 931 return true;1004 return TRUE; 932 1005 } 933 1006 … … 938 1011 info->strs = (bfd_byte *) bfd_alloc (abfd, strsize); 939 1012 if (info->stabs == NULL || info->strs == NULL) 940 return false;941 942 if (! bfd_get_section_contents (abfd, info->stabsec, info->stabs, 0,943 stabsize)944 || ! bfd_get_section_contents (abfd, info->strsec, info->strs, 0,945 strsize))946 return false;1013 return FALSE; 1014 1015 if (! bfd_get_section_contents (abfd, info->stabsec, info->stabs, 1016 (bfd_vma) 0, stabsize) 1017 || ! bfd_get_section_contents (abfd, info->strsec, info->strs, 1018 (bfd_vma) 0, strsize)) 1019 return FALSE; 947 1020 948 1021 /* If this is a relocateable object file, we have to relocate … … 952 1025 reloc_size = bfd_get_reloc_upper_bound (abfd, info->stabsec); 953 1026 if (reloc_size < 0) 954 return false;955 reloc_vector = (arelent **) bfd_malloc ( reloc_size);1027 return FALSE; 1028 reloc_vector = (arelent **) bfd_malloc ((bfd_size_type) reloc_size); 956 1029 if (reloc_vector == NULL && reloc_size != 0) 957 return false;1030 return FALSE; 958 1031 reloc_count = bfd_canonicalize_reloc (abfd, info->stabsec, reloc_vector, 959 1032 symbols); … … 962 1035 if (reloc_vector != NULL) 963 1036 free (reloc_vector); 964 return false;1037 return FALSE; 965 1038 } 966 1039 if (reloc_count > 0) … … 987 1060 if (reloc_vector != NULL) 988 1061 free (reloc_vector); 989 return false;1062 return FALSE; 990 1063 } 991 1064 … … 994 1067 sym = *r->sym_ptr_ptr; 995 1068 val += sym->value + sym->section->vma + r->addend; 996 bfd_put_32 (abfd, val, info->stabs + r->address);1069 bfd_put_32 (abfd, (bfd_vma) val, info->stabs + r->address); 997 1070 } 998 1071 } … … 1011 1084 for (stab = info->stabs; stab < info->stabs + stabsize; stab += STABSIZE) 1012 1085 { 1013 if (stab[TYPEOFF] == N_SO)1086 if (stab[TYPEOFF] == (bfd_byte) N_SO) 1014 1087 { 1015 1088 /* N_SO with null name indicates EOF */ … … 1025 1098 /* two N_SO's in a row is a filename and directory. Skip */ 1026 1099 if (stab + STABSIZE < info->stabs + stabsize 1027 && *(stab + STABSIZE + TYPEOFF) == N_SO)1100 && *(stab + STABSIZE + TYPEOFF) == (bfd_byte) N_SO) 1028 1101 { 1029 1102 stab += STABSIZE; 1030 1103 } 1031 1104 } 1032 else if (stab[TYPEOFF] == N_FUN)1105 else if (stab[TYPEOFF] == (bfd_byte) N_FUN) 1033 1106 { 1034 1107 saw_fun = 1; … … 1041 1114 1042 1115 if (info->indextablesize == 0) 1043 return true;1116 return TRUE; 1044 1117 ++info->indextablesize; 1045 1118 1046 info->indextable = ((struct indexentry *) 1047 bfd_alloc (abfd, 1048 (sizeof (struct indexentry) 1049 * info->indextablesize))); 1119 amt = info->indextablesize; 1120 amt *= sizeof (struct indexentry); 1121 info->indextable = (struct indexentry *) bfd_alloc (abfd, amt); 1050 1122 if (info->indextable == NULL) 1051 return false;1123 return FALSE; 1052 1124 1053 1125 file_name = NULL; … … 1100 1172 last_stab = stab; 1101 1173 if (stab + STABSIZE >= info->stabs + stabsize 1102 || *(stab + STABSIZE + TYPEOFF) != N_SO)1174 || *(stab + STABSIZE + TYPEOFF) != (bfd_byte) N_SO) 1103 1175 { 1104 1176 directory_name = NULL; … … 1165 1237 1166 1238 info->indextablesize = i; 1167 qsort (info->indextable, i, sizeof (struct indexentry), cmpindexentry); 1239 qsort (info->indextable, (size_t) i, sizeof (struct indexentry), 1240 cmpindexentry); 1168 1241 1169 1242 *pinfo = (PTR) info; … … 1186 1259 #endif 1187 1260 { 1261 long low, high; 1262 long mid = -1; 1263 1188 1264 /* Cache non-existant or invalid. Do binary search on 1189 1265 indextable. */ 1190 1191 long low, high;1192 long mid = -1;1193 1194 1266 indexentry = NULL; 1195 1267 … … 1213 1285 1214 1286 if (indexentry == NULL) 1215 return true;1287 return TRUE; 1216 1288 1217 1289 stab = indexentry->stab + STABSIZE; … … 1222 1294 str = indexentry->str; 1223 1295 1296 saw_line = FALSE; 1297 saw_func = FALSE; 1224 1298 for (; stab < (indexentry+1)->stab; stab += STABSIZE) 1225 1299 { 1226 b oolean done;1300 bfd_boolean done; 1227 1301 bfd_vma val; 1228 1302 1229 done = false;1303 done = FALSE; 1230 1304 1231 1305 switch (stab[TYPEOFF]) … … 1244 1318 case N_DSLINE: 1245 1319 case N_BSLINE: 1246 /* A line number. The value is relative to the start of the 1247 current function. */ 1248 val = indexentry->val + bfd_get_32 (abfd, stab + VALOFF); 1249 if (val <= offset) 1320 /* A line number. If the function was specified, then the value 1321 is relative to the start of the function. Otherwise, the 1322 value is an absolute address. */ 1323 val = ((indexentry->function_name ? indexentry->val : 0) 1324 + bfd_get_32 (abfd, stab + VALOFF)); 1325 /* If this line starts before our desired offset, or if it's 1326 the first line we've been able to find, use it. The 1327 !saw_line check works around a bug in GCC 2.95.3, which emits 1328 the first N_SLINE late. */ 1329 if (!saw_line || val <= offset) 1250 1330 { 1251 1331 *pline = bfd_get_16 (abfd, stab + DESCOFF); … … 1259 1339 } 1260 1340 if (val > offset) 1261 done = true; 1341 done = TRUE; 1342 saw_line = TRUE; 1262 1343 break; 1263 1344 1264 1345 case N_FUN: 1265 1346 case N_SO: 1266 done = true; 1347 if (saw_func || saw_line) 1348 done = TRUE; 1349 saw_func = TRUE; 1267 1350 break; 1268 1351 } … … 1272 1355 } 1273 1356 1274 *pfound = true; 1275 1276 if (IS_ABSOLUTE_PATH(file_name) || directory_name == NULL) 1357 *pfound = TRUE; 1358 1359 if (file_name == NULL || IS_ABSOLUTE_PATH (file_name) 1360 || directory_name == NULL) 1277 1361 *pfilename = file_name; 1278 1362 else … … 1285 1369 || strcmp (info->filename + dirlen, file_name) != 0) 1286 1370 { 1371 size_t len; 1372 1287 1373 if (info->filename != NULL) 1288 1374 free (info->filename); 1289 info->filename = (char *) bfd_malloc (dirlen + 1290 strlen (file_name) 1291 + 1); 1375 len = strlen (file_name) + 1; 1376 info->filename = (char *) bfd_malloc ((bfd_size_type) dirlen + len); 1292 1377 if (info->filename == NULL) 1293 return false;1294 strcpy (info->filename, directory_name);1295 strcpy (info->filename + dirlen, file_name);1378 return FALSE; 1379 memcpy (info->filename, directory_name, dirlen); 1380 memcpy (info->filename + dirlen, file_name, len); 1296 1381 } 1297 1382 … … 1306 1391 to clobber the colon. It's OK to change the name, since the 1307 1392 string is in our own local storage anyhow. */ 1308 1309 1393 s = strchr (indexentry->function_name, ':'); 1310 1394 if (s != NULL) … … 1314 1398 } 1315 1399 1316 return true;1400 return TRUE; 1317 1401 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/binutils/bfd/sysdep.h
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r617 r618 132 132 #endif 133 133 134 /* Define offsetof for those systems which lack it */ 135 136 #ifndef offsetof 137 #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) 138 #endif 139 134 140 #ifdef ENABLE_NLS 135 141 #include <libintl.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/binutils/bfd/targets.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r617 r618 1 1 /* Generic target-file-type support for the BFD library. 2 2 Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 3 2000, 2001 3 2000, 2001, 2002, 2003 4 4 Free Software Foundation, Inc. 5 5 Written by Cygnus Support. 6 6 7 This file is part of BFD, the Binary File Descriptor library.8 9 This program is free software; you can redistribute it and/or modify10 it under the terms of the GNU General Public License as published by11 the Free Software Foundation; either version 2 of the License, or12 (at your option) any later version.13 14 This program is distributed in the hope that it will be useful,15 but WITHOUT ANY WARRANTY; without even the implied warranty of16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the17 GNU General Public License for more details.18 19 You should have received a copy of the GNU General Public License20 along with this program; if not, write to the Free Software21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */7 This file is part of BFD, the Binary File Descriptor library. 8 9 This program is free software; you can redistribute it and/or modify 10 it under the terms of the GNU General Public License as published by 11 the Free Software Foundation; either version 2 of the License, or 12 (at your option) any later version. 13 14 This program is distributed in the hope that it will be useful, 15 but WITHOUT ANY WARRANTY; without even the implied warranty of 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 GNU General Public License for more details. 18 19 You should have received a copy of the GNU General Public License 20 along with this program; if not, write to the Free Software 21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 22 22 23 23 #include "bfd.h" … … 71 71 If <<target_defaulted>> has been set, each possible target 72 72 type is tried to see if it recognizes the specified format. 73 <<bfd_check_format>> returns << true>> when the caller guesses right.73 <<bfd_check_format>> returns <<TRUE>> when the caller guesses right. 74 74 @menu 75 75 @* bfd_target:: … … 126 126 . (bfd_assert (__FILE__,__LINE__), NULL)) 127 127 .#endif 128 128 . 129 129 This is the structure which defines the type of BFD this is. The 130 130 <<xvec>> member of the struct <<bfd>> itself points here. Each … … 136 136 macro to define them both! 137 137 138 .enum bfd_flavour { 138 .enum bfd_flavour 139 .{ 139 140 . bfd_target_unknown_flavour, 140 141 . bfd_target_aout_flavour, … … 154 155 . bfd_target_msdos_flavour, 155 156 . bfd_target_ovax_flavour, 156 . bfd_target_evax_flavour 157 . bfd_target_evax_flavour, 158 . bfd_target_mmo_flavour, 159 . bfd_target_mach_o_flavour, 160 . bfd_target_pef_flavour, 161 . bfd_target_pef_xlib_flavour, 162 . bfd_target_sym_flavour 157 163 .}; 158 164 . … … 164 170 .typedef struct bfd_target 165 171 .{ 166 167 Identifies the kind of target, e.g., SunOS4, Ultrix, etc. 168 172 . {* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. *} 169 173 . char *name; 170 171 The "flavour" of a back end is a general indication about the contents 172 of a file. 173 174 . 175 . {* The "flavour" of a back end is a general indication about 176 . the contents of a file. *} 174 177 . enum bfd_flavour flavour; 175 176 The order of bytes within the data area of a file. 177 178 . 179 . {* The order of bytes within the data area of a file. *} 178 180 . enum bfd_endian byteorder; 179 180 The order of bytes within the header parts of a file. 181 181 . 182 . {* The order of bytes within the header parts of a file. *} 182 183 . enum bfd_endian header_byteorder; 183 184 A mask of all the flags which an executable may have set - 185 from the set <<BFD_NO_FLAGS>>, <<HAS_RELOC>>, ...<<D_PAGED>>. 186 184 . 185 . {* A mask of all the flags which an executable may have set - 186 . from the set <<BFD_NO_FLAGS>>, <<HAS_RELOC>>, ...<<D_PAGED>>. *} 187 187 . flagword object_flags; 188 189 A mask of all the flags which a section may have set - from 190 the set <<SEC_NO_FLAGS>>, <<SEC_ALLOC>>, ...<<SET_NEVER_LOAD>>. 191 188 . 189 . {* A mask of all the flags which a section may have set - from 190 . the set <<SEC_NO_FLAGS>>, <<SEC_ALLOC>>, ...<<SET_NEVER_LOAD>>. *} 192 191 . flagword section_flags; 193 194 The character normally found at the front of a symbol 195 (if any), perhaps `_'. 196 192 . 193 . {* The character normally found at the front of a symbol. 194 . (if any), perhaps `_'. *} 197 195 . char symbol_leading_char; 198 199 The pad character for file names within an archive header. 200 196 . 197 . {* The pad character for file names within an archive header. *} 201 198 . char ar_pad_char; 202 203 The maximum number of characters in an archive header. 204 199 . 200 . {* The maximum number of characters in an archive header. *} 205 201 . unsigned short ar_max_namelen; 206 207 Entries for byte swapping for data. These are different from the other 208 entry points, since they don't take a BFD asthe first argument. 209 Certain other handlers could do the same. 210 211 . bfd_vma (*bfd_getx64) PARAMS ((const bfd_byte *)); 202 . 203 . {* Entries for byte swapping for data. These are different from the 204 . other entry points, since they don't take a BFD asthe first argument. 205 . Certain other handlers could do the same. *} 206 . bfd_vma (*bfd_getx64) PARAMS ((const bfd_byte *)); 212 207 . bfd_signed_vma (*bfd_getx_signed_64) PARAMS ((const bfd_byte *)); 213 . void (*bfd_putx64) PARAMS ((bfd_vma, bfd_byte *));214 . bfd_vma (*bfd_getx32) PARAMS ((const bfd_byte *));208 . void (*bfd_putx64) PARAMS ((bfd_vma, bfd_byte *)); 209 . bfd_vma (*bfd_getx32) PARAMS ((const bfd_byte *)); 215 210 . bfd_signed_vma (*bfd_getx_signed_32) PARAMS ((const bfd_byte *)); 216 . void (*bfd_putx32) PARAMS ((bfd_vma, bfd_byte *));217 . bfd_vma (*bfd_getx16) PARAMS ((const bfd_byte *));211 . void (*bfd_putx32) PARAMS ((bfd_vma, bfd_byte *)); 212 . bfd_vma (*bfd_getx16) PARAMS ((const bfd_byte *)); 218 213 . bfd_signed_vma (*bfd_getx_signed_16) PARAMS ((const bfd_byte *)); 219 . void (*bfd_putx16) PARAMS ((bfd_vma, bfd_byte *)); 220 221 Byte swapping for the headers 222 223 . bfd_vma (*bfd_h_getx64) PARAMS ((const bfd_byte *)); 214 . void (*bfd_putx16) PARAMS ((bfd_vma, bfd_byte *)); 215 . 216 . {* Byte swapping for the headers. *} 217 . bfd_vma (*bfd_h_getx64) PARAMS ((const bfd_byte *)); 224 218 . bfd_signed_vma (*bfd_h_getx_signed_64) PARAMS ((const bfd_byte *)); 225 . void (*bfd_h_putx64) PARAMS ((bfd_vma, bfd_byte *));226 . bfd_vma (*bfd_h_getx32) PARAMS ((const bfd_byte *));219 . void (*bfd_h_putx64) PARAMS ((bfd_vma, bfd_byte *)); 220 . bfd_vma (*bfd_h_getx32) PARAMS ((const bfd_byte *)); 227 221 . bfd_signed_vma (*bfd_h_getx_signed_32) PARAMS ((const bfd_byte *)); 228 . void (*bfd_h_putx32) PARAMS ((bfd_vma, bfd_byte *));229 . bfd_vma (*bfd_h_getx16) PARAMS ((const bfd_byte *));222 . void (*bfd_h_putx32) PARAMS ((bfd_vma, bfd_byte *)); 223 . bfd_vma (*bfd_h_getx16) PARAMS ((const bfd_byte *)); 230 224 . bfd_signed_vma (*bfd_h_getx_signed_16) PARAMS ((const bfd_byte *)); 231 . void (*bfd_h_putx16) PARAMS ((bfd_vma, bfd_byte *)); 232 233 Format dependent routines: these are vectors of entry points 234 within the target vector structure, one for each format to check. 235 236 Check the format of a file being read. Return a <<bfd_target *>> or zero. 237 225 . void (*bfd_h_putx16) PARAMS ((bfd_vma, bfd_byte *)); 226 . 227 . {* Format dependent routines: these are vectors of entry points 228 . within the target vector structure, one for each format to check. *} 229 . 230 . {* Check the format of a file being read. Return a <<bfd_target *>> or zero. *} 238 231 . const struct bfd_target *(*_bfd_check_format[bfd_type_end]) PARAMS ((bfd *)); 239 240 Set the format of a file being written. 241 242 . boolean (*_bfd_set_format[bfd_type_end]) PARAMS ((bfd *)); 243 244 Write cached information into a file being written, at <<bfd_close>>. 245 246 . boolean (*_bfd_write_contents[bfd_type_end]) PARAMS ((bfd *)); 247 232 . 233 . {* Set the format of a file being written. *} 234 . bfd_boolean (*_bfd_set_format[bfd_type_end]) PARAMS ((bfd *)); 235 . 236 . {* Write cached information into a file being written, at <<bfd_close>>. *} 237 . bfd_boolean (*_bfd_write_contents[bfd_type_end]) PARAMS ((bfd *)); 238 . 248 239 The general target vector. These vectors are initialized using the 249 240 BFD_JUMP_TABLE macros. 250 251 241 . 252 242 . {* Generic entry points. *} 253 .#define BFD_JUMP_TABLE_GENERIC(NAME)\ 254 .CAT(NAME,_close_and_cleanup),\ 255 .CAT(NAME,_bfd_free_cached_info),\ 256 .CAT(NAME,_new_section_hook),\ 257 .CAT(NAME,_get_section_contents),\ 258 .CAT(NAME,_get_section_contents_in_window) 243 Do not "beautify" the CONCAT* macro args. Traditional C will not 244 remove whitespace added here, and thus will fail to concatenate 245 the tokens. 246 .#define BFD_JUMP_TABLE_GENERIC(NAME) \ 247 .CONCAT2 (NAME,_close_and_cleanup), \ 248 .CONCAT2 (NAME,_bfd_free_cached_info), \ 249 .CONCAT2 (NAME,_new_section_hook), \ 250 .CONCAT2 (NAME,_get_section_contents), \ 251 .CONCAT2 (NAME,_get_section_contents_in_window) 259 252 . 260 253 . {* Called when the BFD is being closed to do any necessary cleanup. *} 261 . b oolean(*_close_and_cleanup) PARAMS ((bfd *));254 . bfd_boolean (*_close_and_cleanup) PARAMS ((bfd *)); 262 255 . {* Ask the BFD to free all cached information. *} 263 . b oolean (*_bfd_free_cached_info) PARAMS ((bfd *));256 . bfd_boolean (*_bfd_free_cached_info) PARAMS ((bfd *)); 264 257 . {* Called when a new section is created. *} 265 . b oolean(*_new_section_hook) PARAMS ((bfd *, sec_ptr));258 . bfd_boolean (*_new_section_hook) PARAMS ((bfd *, sec_ptr)); 266 259 . {* Read the contents of a section. *} 267 . boolean (*_bfd_get_section_contents) PARAMS ((bfd *, sec_ptr, PTR, 268 . file_ptr, bfd_size_type)); 269 . boolean (*_bfd_get_section_contents_in_window) 270 . PARAMS ((bfd *, sec_ptr, bfd_window *, 271 . file_ptr, bfd_size_type)); 260 . bfd_boolean (*_bfd_get_section_contents) 261 . PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type)); 262 . bfd_boolean (*_bfd_get_section_contents_in_window) 263 . PARAMS ((bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type)); 272 264 . 273 265 . {* Entry points to copy private data. *} 274 .#define BFD_JUMP_TABLE_COPY(NAME) \275 .C AT(NAME,_bfd_copy_private_bfd_data),\276 .C AT(NAME,_bfd_merge_private_bfd_data),\277 .C AT(NAME,_bfd_copy_private_section_data),\278 .C AT(NAME,_bfd_copy_private_symbol_data),\279 .C AT(NAME,_bfd_set_private_flags),\280 .C AT(NAME,_bfd_print_private_bfd_data)\266 .#define BFD_JUMP_TABLE_COPY(NAME) \ 267 .CONCAT2 (NAME,_bfd_copy_private_bfd_data), \ 268 .CONCAT2 (NAME,_bfd_merge_private_bfd_data), \ 269 .CONCAT2 (NAME,_bfd_copy_private_section_data), \ 270 .CONCAT2 (NAME,_bfd_copy_private_symbol_data), \ 271 .CONCAT2 (NAME,_bfd_set_private_flags), \ 272 .CONCAT2 (NAME,_bfd_print_private_bfd_data) \ 281 273 . {* Called to copy BFD general private data from one object file 282 274 . to another. *} 283 . b oolean(*_bfd_copy_private_bfd_data) PARAMS ((bfd *, bfd *));275 . bfd_boolean (*_bfd_copy_private_bfd_data) PARAMS ((bfd *, bfd *)); 284 276 . {* Called to merge BFD general private data from one object file 285 277 . to a common output file when linking. *} 286 . b oolean(*_bfd_merge_private_bfd_data) PARAMS ((bfd *, bfd *));278 . bfd_boolean (*_bfd_merge_private_bfd_data) PARAMS ((bfd *, bfd *)); 287 279 . {* Called to copy BFD private section data from one object file 288 280 . to another. *} 289 . b oolean (*_bfd_copy_private_section_data) PARAMS ((bfd *, sec_ptr,290 . 281 . bfd_boolean (*_bfd_copy_private_section_data) 282 . PARAMS ((bfd *, sec_ptr, bfd *, sec_ptr)); 291 283 . {* Called to copy BFD private symbol data from one symbol 292 284 . to another. *} 293 . b oolean (*_bfd_copy_private_symbol_data) PARAMS ((bfd *, asymbol *,294 . 295 . {* Called to set private backend flags *}296 . b oolean(*_bfd_set_private_flags) PARAMS ((bfd *, flagword));297 . 298 . {* Called to print private BFD data *}299 . b oolean(*_bfd_print_private_bfd_data) PARAMS ((bfd *, PTR));285 . bfd_boolean (*_bfd_copy_private_symbol_data) 286 . PARAMS ((bfd *, asymbol *, bfd *, asymbol *)); 287 . {* Called to set private backend flags. *} 288 . bfd_boolean (*_bfd_set_private_flags) PARAMS ((bfd *, flagword)); 289 . 290 . {* Called to print private BFD data. *} 291 . bfd_boolean (*_bfd_print_private_bfd_data) PARAMS ((bfd *, PTR)); 300 292 . 301 293 . {* Core file entry points. *} 302 .#define BFD_JUMP_TABLE_CORE(NAME) \303 .C AT(NAME,_core_file_failing_command),\304 .C AT(NAME,_core_file_failing_signal),\305 .C AT(NAME,_core_file_matches_executable_p)306 . char * (*_core_file_failing_command) PARAMS ((bfd *));307 . int (*_core_file_failing_signal) PARAMS ((bfd *));308 . b oolean(*_core_file_matches_executable_p) PARAMS ((bfd *, bfd *));294 .#define BFD_JUMP_TABLE_CORE(NAME) \ 295 .CONCAT2 (NAME,_core_file_failing_command), \ 296 .CONCAT2 (NAME,_core_file_failing_signal), \ 297 .CONCAT2 (NAME,_core_file_matches_executable_p) 298 . char * (*_core_file_failing_command) PARAMS ((bfd *)); 299 . int (*_core_file_failing_signal) PARAMS ((bfd *)); 300 . bfd_boolean (*_core_file_matches_executable_p) PARAMS ((bfd *, bfd *)); 309 301 . 310 302 . {* Archive entry points. *} 311 .#define BFD_JUMP_TABLE_ARCHIVE(NAME)\ 312 .CAT(NAME,_slurp_armap),\ 313 .CAT(NAME,_slurp_extended_name_table),\ 314 .CAT(NAME,_construct_extended_name_table),\ 315 .CAT(NAME,_truncate_arname),\ 316 .CAT(NAME,_write_armap),\ 317 .CAT(NAME,_read_ar_hdr),\ 318 .CAT(NAME,_openr_next_archived_file),\ 319 .CAT(NAME,_get_elt_at_index),\ 320 .CAT(NAME,_generic_stat_arch_elt),\ 321 .CAT(NAME,_update_armap_timestamp) 322 . boolean (*_bfd_slurp_armap) PARAMS ((bfd *)); 323 . boolean (*_bfd_slurp_extended_name_table) PARAMS ((bfd *)); 324 . boolean (*_bfd_construct_extended_name_table) 325 . PARAMS ((bfd *, char **, bfd_size_type *, const char **)); 326 . void (*_bfd_truncate_arname) PARAMS ((bfd *, CONST char *, char *)); 327 . boolean (*write_armap) PARAMS ((bfd *arch, 328 . unsigned int elength, 329 . struct orl *map, 330 . unsigned int orl_count, 331 . int stridx)); 332 . PTR (*_bfd_read_ar_hdr_fn) PARAMS ((bfd *)); 333 . bfd * (*openr_next_archived_file) PARAMS ((bfd *arch, bfd *prev)); 303 .#define BFD_JUMP_TABLE_ARCHIVE(NAME) \ 304 .CONCAT2 (NAME,_slurp_armap), \ 305 .CONCAT2 (NAME,_slurp_extended_name_table), \ 306 .CONCAT2 (NAME,_construct_extended_name_table), \ 307 .CONCAT2 (NAME,_truncate_arname), \ 308 .CONCAT2 (NAME,_write_armap), \ 309 .CONCAT2 (NAME,_read_ar_hdr), \ 310 .CONCAT2 (NAME,_openr_next_archived_file), \ 311 .CONCAT2 (NAME,_get_elt_at_index), \ 312 .CONCAT2 (NAME,_generic_stat_arch_elt), \ 313 .CONCAT2 (NAME,_update_armap_timestamp) 314 . bfd_boolean (*_bfd_slurp_armap) PARAMS ((bfd *)); 315 . bfd_boolean (*_bfd_slurp_extended_name_table) PARAMS ((bfd *)); 316 . bfd_boolean (*_bfd_construct_extended_name_table) 317 . PARAMS ((bfd *, char **, bfd_size_type *, const char **)); 318 . void (*_bfd_truncate_arname) PARAMS ((bfd *, const char *, char *)); 319 . bfd_boolean (*write_armap) 320 . PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int)); 321 . PTR (*_bfd_read_ar_hdr_fn) PARAMS ((bfd *)); 322 . bfd * (*openr_next_archived_file) PARAMS ((bfd *, bfd *)); 334 323 .#define bfd_get_elt_at_index(b,i) BFD_SEND(b, _bfd_get_elt_at_index, (b,i)) 335 . bfd * (*_bfd_get_elt_at_index) PARAMS ((bfd *, symindex));336 . int (*_bfd_stat_arch_elt) PARAMS ((bfd *, struct stat *));337 . b oolean(*_bfd_update_armap_timestamp) PARAMS ((bfd *));324 . bfd * (*_bfd_get_elt_at_index) PARAMS ((bfd *, symindex)); 325 . int (*_bfd_stat_arch_elt) PARAMS ((bfd *, struct stat *)); 326 . bfd_boolean (*_bfd_update_armap_timestamp) PARAMS ((bfd *)); 338 327 . 339 328 . {* Entry points used for symbols. *} 340 .#define BFD_JUMP_TABLE_SYMBOLS(NAME)\ 341 .CAT(NAME,_get_symtab_upper_bound),\ 342 .CAT(NAME,_get_symtab),\ 343 .CAT(NAME,_make_empty_symbol),\ 344 .CAT(NAME,_print_symbol),\ 345 .CAT(NAME,_get_symbol_info),\ 346 .CAT(NAME,_bfd_is_local_label_name),\ 347 .CAT(NAME,_get_lineno),\ 348 .CAT(NAME,_find_nearest_line),\ 349 .CAT(NAME,_bfd_make_debug_symbol),\ 350 .CAT(NAME,_read_minisymbols),\ 351 .CAT(NAME,_minisymbol_to_symbol) 352 . long (*_bfd_get_symtab_upper_bound) PARAMS ((bfd *)); 353 . long (*_bfd_canonicalize_symtab) PARAMS ((bfd *, 354 . struct symbol_cache_entry **)); 355 . struct symbol_cache_entry * 356 . (*_bfd_make_empty_symbol) PARAMS ((bfd *)); 357 . void (*_bfd_print_symbol) PARAMS ((bfd *, PTR, 358 . struct symbol_cache_entry *, 359 . bfd_print_symbol_type)); 329 .#define BFD_JUMP_TABLE_SYMBOLS(NAME) \ 330 .CONCAT2 (NAME,_get_symtab_upper_bound), \ 331 .CONCAT2 (NAME,_get_symtab), \ 332 .CONCAT2 (NAME,_make_empty_symbol), \ 333 .CONCAT2 (NAME,_print_symbol), \ 334 .CONCAT2 (NAME,_get_symbol_info), \ 335 .CONCAT2 (NAME,_bfd_is_local_label_name), \ 336 .CONCAT2 (NAME,_get_lineno), \ 337 .CONCAT2 (NAME,_find_nearest_line), \ 338 .CONCAT2 (NAME,_bfd_make_debug_symbol), \ 339 .CONCAT2 (NAME,_read_minisymbols), \ 340 .CONCAT2 (NAME,_minisymbol_to_symbol) 341 . long (*_bfd_get_symtab_upper_bound) PARAMS ((bfd *)); 342 . long (*_bfd_canonicalize_symtab) PARAMS ((bfd *, 343 . struct symbol_cache_entry **)); 344 . struct symbol_cache_entry * 345 . (*_bfd_make_empty_symbol) PARAMS ((bfd *)); 346 . void (*_bfd_print_symbol) 347 . PARAMS ((bfd *, PTR, struct symbol_cache_entry *, bfd_print_symbol_type)); 360 348 .#define bfd_print_symbol(b,p,s,e) BFD_SEND(b, _bfd_print_symbol, (b,p,s,e)) 361 . void (*_bfd_get_symbol_info) PARAMS ((bfd *, 362 . struct symbol_cache_entry *, 363 . symbol_info *)); 349 . void (*_bfd_get_symbol_info) 350 . PARAMS ((bfd *, struct symbol_cache_entry *, symbol_info *)); 364 351 .#define bfd_get_symbol_info(b,p,e) BFD_SEND(b, _bfd_get_symbol_info, (b,p,e)) 365 . boolean (*_bfd_is_local_label_name) PARAMS ((bfd *, const char *)); 366 . 367 . alent * (*_get_lineno) PARAMS ((bfd *, struct symbol_cache_entry *)); 368 . boolean (*_bfd_find_nearest_line) PARAMS ((bfd *abfd, 369 . struct sec *section, struct symbol_cache_entry **symbols, 370 . bfd_vma offset, CONST char **file, CONST char **func, 371 . unsigned int *line)); 352 . bfd_boolean (*_bfd_is_local_label_name) PARAMS ((bfd *, const char *)); 353 . 354 . alent * (*_get_lineno) PARAMS ((bfd *, struct symbol_cache_entry *)); 355 . bfd_boolean (*_bfd_find_nearest_line) 356 . PARAMS ((bfd *, struct sec *, struct symbol_cache_entry **, bfd_vma, 357 . const char **, const char **, unsigned int *)); 372 358 . {* Back-door to allow format-aware applications to create debug symbols 373 359 . while using BFD for everything else. Currently used by the assembler 374 360 . when creating COFF files. *} 375 . asymbol * (*_bfd_make_debug_symbol) PARAMS (( 376 . bfd *abfd, 377 . void *ptr, 378 . unsigned long size)); 361 . asymbol * (*_bfd_make_debug_symbol) 362 . PARAMS ((bfd *, void *, unsigned long size)); 379 363 .#define bfd_read_minisymbols(b, d, m, s) \ 380 364 . BFD_SEND (b, _read_minisymbols, (b, d, m, s)) 381 . long (*_read_minisymbols) PARAMS ((bfd *, boolean, PTR *,382 . 365 . long (*_read_minisymbols) 366 . PARAMS ((bfd *, bfd_boolean, PTR *, unsigned int *)); 383 367 .#define bfd_minisymbol_to_symbol(b, d, m, f) \ 384 368 . BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) 385 . asymbol * (*_minisymbol_to_symbol) PARAMS ((bfd *, boolean, const PTR,386 . 369 . asymbol * (*_minisymbol_to_symbol) 370 . PARAMS ((bfd *, bfd_boolean, const PTR, asymbol *)); 387 371 . 388 372 . {* Routines for relocs. *} 389 .#define BFD_JUMP_TABLE_RELOCS(NAME) \390 .C AT(NAME,_get_reloc_upper_bound),\391 .C AT(NAME,_canonicalize_reloc),\392 .C AT(NAME,_bfd_reloc_type_lookup)393 . long (*_get_reloc_upper_bound) PARAMS ((bfd *, sec_ptr));394 . long (*_bfd_canonicalize_reloc) PARAMS ((bfd *, sec_ptr, arelent **,395 . 373 .#define BFD_JUMP_TABLE_RELOCS(NAME) \ 374 .CONCAT2 (NAME,_get_reloc_upper_bound), \ 375 .CONCAT2 (NAME,_canonicalize_reloc), \ 376 .CONCAT2 (NAME,_bfd_reloc_type_lookup) 377 . long (*_get_reloc_upper_bound) PARAMS ((bfd *, sec_ptr)); 378 . long (*_bfd_canonicalize_reloc) 379 . PARAMS ((bfd *, sec_ptr, arelent **, struct symbol_cache_entry **)); 396 380 . {* See documentation on reloc types. *} 397 381 . reloc_howto_type * 398 . (*reloc_type_lookup) PARAMS ((bfd *abfd, 399 . bfd_reloc_code_real_type code)); 382 . (*reloc_type_lookup) PARAMS ((bfd *, bfd_reloc_code_real_type)); 400 383 . 401 384 . {* Routines used when writing an object file. *} 402 .#define BFD_JUMP_TABLE_WRITE(NAME) \403 .C AT(NAME,_set_arch_mach),\404 .C AT(NAME,_set_section_contents)405 . b oolean (*_bfd_set_arch_mach) PARAMS ((bfd *, enum bfd_architecture,406 . 407 . b oolean (*_bfd_set_section_contents) PARAMS ((bfd *, sec_ptr, PTR,408 . 385 .#define BFD_JUMP_TABLE_WRITE(NAME) \ 386 .CONCAT2 (NAME,_set_arch_mach), \ 387 .CONCAT2 (NAME,_set_section_contents) 388 . bfd_boolean (*_bfd_set_arch_mach) 389 . PARAMS ((bfd *, enum bfd_architecture, unsigned long)); 390 . bfd_boolean (*_bfd_set_section_contents) 391 . PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type)); 409 392 . 410 393 . {* Routines used by the linker. *} 411 .#define BFD_JUMP_TABLE_LINK(NAME)\ 412 .CAT(NAME,_sizeof_headers),\ 413 .CAT(NAME,_bfd_get_relocated_section_contents),\ 414 .CAT(NAME,_bfd_relax_section),\ 415 .CAT(NAME,_bfd_link_hash_table_create),\ 416 .CAT(NAME,_bfd_link_add_symbols),\ 417 .CAT(NAME,_bfd_final_link),\ 418 .CAT(NAME,_bfd_link_split_section),\ 419 .CAT(NAME,_bfd_gc_sections) 420 . int (*_bfd_sizeof_headers) PARAMS ((bfd *, boolean)); 421 . bfd_byte * (*_bfd_get_relocated_section_contents) PARAMS ((bfd *, 422 . struct bfd_link_info *, struct bfd_link_order *, 423 . bfd_byte *data, boolean relocateable, 424 . struct symbol_cache_entry **)); 425 . 426 . boolean (*_bfd_relax_section) PARAMS ((bfd *, struct sec *, 427 . struct bfd_link_info *, boolean *again)); 394 .#define BFD_JUMP_TABLE_LINK(NAME) \ 395 .CONCAT2 (NAME,_sizeof_headers), \ 396 .CONCAT2 (NAME,_bfd_get_relocated_section_contents), \ 397 .CONCAT2 (NAME,_bfd_relax_section), \ 398 .CONCAT2 (NAME,_bfd_link_hash_table_create), \ 399 .CONCAT2 (NAME,_bfd_link_hash_table_free), \ 400 .CONCAT2 (NAME,_bfd_link_add_symbols), \ 401 .CONCAT2 (NAME,_bfd_link_just_syms), \ 402 .CONCAT2 (NAME,_bfd_final_link), \ 403 .CONCAT2 (NAME,_bfd_link_split_section), \ 404 .CONCAT2 (NAME,_bfd_gc_sections), \ 405 .CONCAT2 (NAME,_bfd_merge_sections), \ 406 .CONCAT2 (NAME,_bfd_discard_group) 407 . int (*_bfd_sizeof_headers) PARAMS ((bfd *, bfd_boolean)); 408 . bfd_byte * (*_bfd_get_relocated_section_contents) 409 . PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, 410 . bfd_byte *, bfd_boolean, struct symbol_cache_entry **)); 411 . 412 . bfd_boolean (*_bfd_relax_section) 413 . PARAMS ((bfd *, struct sec *, struct bfd_link_info *, bfd_boolean *)); 428 414 . 429 415 . {* Create a hash table for the linker. Different backends store 430 416 . different information in this table. *} 431 . struct bfd_link_hash_table *(*_bfd_link_hash_table_create) PARAMS ((bfd *)); 417 . struct bfd_link_hash_table * 418 . (*_bfd_link_hash_table_create) PARAMS ((bfd *)); 419 . 420 . {* Release the memory associated with the linker hash table. *} 421 . void (*_bfd_link_hash_table_free) 422 . PARAMS ((struct bfd_link_hash_table *)); 432 423 . 433 424 . {* Add symbols from this object file into the hash table. *} 434 . boolean (*_bfd_link_add_symbols) PARAMS ((bfd *, struct bfd_link_info *)); 425 . bfd_boolean (*_bfd_link_add_symbols) 426 . PARAMS ((bfd *, struct bfd_link_info *)); 427 . 428 . {* Indicate that we are only retrieving symbol values from this section. *} 429 . void (*_bfd_link_just_syms) 430 . PARAMS ((asection *, struct bfd_link_info *)); 435 431 . 436 432 . {* Do a link based on the link_order structures attached to each 437 433 . section of the BFD. *} 438 . b oolean (*_bfd_final_link) PARAMS ((bfd *, struct bfd_link_info *));434 . bfd_boolean (*_bfd_final_link) PARAMS ((bfd *, struct bfd_link_info *)); 439 435 . 440 436 . {* Should this section be split up into smaller pieces during linking. *} 441 . b oolean (*_bfd_link_split_section) PARAMS ((bfd *, struct sec *));437 . bfd_boolean (*_bfd_link_split_section) PARAMS ((bfd *, struct sec *)); 442 438 . 443 439 . {* Remove sections that are not referenced from the output. *} 444 . boolean (*_bfd_gc_sections) PARAMS ((bfd *, struct bfd_link_info *)); 440 . bfd_boolean (*_bfd_gc_sections) PARAMS ((bfd *, struct bfd_link_info *)); 441 . 442 . {* Attempt to merge SEC_MERGE sections. *} 443 . bfd_boolean (*_bfd_merge_sections) PARAMS ((bfd *, struct bfd_link_info *)); 444 . 445 . {* Discard members of a group. *} 446 . bfd_boolean (*_bfd_discard_group) PARAMS ((bfd *, struct sec *)); 445 447 . 446 448 . {* Routines to handle dynamic symbols and relocs. *} 447 .#define BFD_JUMP_TABLE_DYNAMIC(NAME) \448 .C AT(NAME,_get_dynamic_symtab_upper_bound),\449 .C AT(NAME,_canonicalize_dynamic_symtab),\450 .C AT(NAME,_get_dynamic_reloc_upper_bound),\451 .C AT(NAME,_canonicalize_dynamic_reloc)452 . {* Get the amount of memory required to hold the dynamic symbols. *}453 . long (*_bfd_get_dynamic_symtab_upper_bound) PARAMS ((bfd *));449 .#define BFD_JUMP_TABLE_DYNAMIC(NAME) \ 450 .CONCAT2 (NAME,_get_dynamic_symtab_upper_bound), \ 451 .CONCAT2 (NAME,_canonicalize_dynamic_symtab), \ 452 .CONCAT2 (NAME,_get_dynamic_reloc_upper_bound), \ 453 .CONCAT2 (NAME,_canonicalize_dynamic_reloc) 454 . {* Get the amount of memory required to hold the dynamic symbols. *} 455 . long (*_bfd_get_dynamic_symtab_upper_bound) PARAMS ((bfd *)); 454 456 . {* Read in the dynamic symbols. *} 455 . long (*_bfd_canonicalize_dynamic_symtab)457 . long (*_bfd_canonicalize_dynamic_symtab) 456 458 . PARAMS ((bfd *, struct symbol_cache_entry **)); 457 459 . {* Get the amount of memory required to hold the dynamic relocs. *} 458 . long (*_bfd_get_dynamic_reloc_upper_bound) PARAMS ((bfd *));460 . long (*_bfd_get_dynamic_reloc_upper_bound) PARAMS ((bfd *)); 459 461 . {* Read in the dynamic relocs. *} 460 . long (*_bfd_canonicalize_dynamic_reloc)462 . long (*_bfd_canonicalize_dynamic_reloc) 461 463 . PARAMS ((bfd *, arelent **, struct symbol_cache_entry **)); 462 464 . … … 468 470 to find an alternative output format that is suitable. 469 471 470 . {* Opposite endian version of this target. *} 471 . const struct bfd_target * alternative_target; 472 . 473 474 Data for use by back-end routines, which isn't generic enough to belong 475 in this structure. 476 477 . PTR backend_data; 472 . {* Opposite endian version of this target. *} 473 . const struct bfd_target * alternative_target; 474 . 475 476 . {* Data for use by back-end routines, which isn't 477 . generic enough to belong in this structure. *} 478 . PTR backend_data; 478 479 . 479 480 .} bfd_target; 480 481 . 481 482 */ 482 483 … … 487 488 extern const bfd_target a29kcoff_big_vec; 488 489 extern const bfd_target a_out_adobe_vec; 490 extern const bfd_target aix5coff64_vec; 489 491 extern const bfd_target aout0_big_vec; 490 492 extern const bfd_target aout_arm_big_vec; … … 517 519 extern const bfd_target bfd_elf32_d10v_vec; 518 520 extern const bfd_target bfd_elf32_d30v_vec; 521 extern const bfd_target bfd_elf32_dlx_big_vec; 519 522 extern const bfd_target bfd_elf32_fr30_vec; 523 extern const bfd_target bfd_elf32_frv_vec; 524 extern const bfd_target bfd_elf32_h8300_vec; 520 525 extern const bfd_target bfd_elf32_hppa_linux_vec; 521 526 extern const bfd_target bfd_elf32_hppa_vec; 522 527 extern const bfd_target bfd_elf32_i370_vec; 528 extern const bfd_target bfd_elf32_i386_freebsd_vec; 523 529 extern const bfd_target bfd_elf32_i386_vec; 524 530 extern const bfd_target bfd_elf32_i860_little_vec; … … 526 532 extern const bfd_target bfd_elf32_i960_vec; 527 533 extern const bfd_target bfd_elf32_ia64_big_vec; 534 extern const bfd_target bfd_elf32_ia64_hpux_big_vec; 535 extern const bfd_target bfd_elf32_ip2k_vec; 536 extern const bfd_target bfd_elf32_iq2000_vec; 528 537 extern const bfd_target bfd_elf32_little_generic_vec; 529 538 extern const bfd_target bfd_elf32_littlearc_vec; … … 540 549 extern const bfd_target bfd_elf32_mn10200_vec; 541 550 extern const bfd_target bfd_elf32_mn10300_vec; 551 extern const bfd_target bfd_elf32_msp430_vec; 552 extern const bfd_target bfd_elf32_nbigmips_vec; 553 extern const bfd_target bfd_elf32_nlittlemips_vec; 554 extern const bfd_target bfd_elf32_ntradbigmips_vec; 555 extern const bfd_target bfd_elf32_ntradlittlemips_vec; 556 extern const bfd_target bfd_elf32_openrisc_vec; 557 extern const bfd_target bfd_elf32_or32_big_vec; 542 558 extern const bfd_target bfd_elf32_pj_vec; 543 559 extern const bfd_target bfd_elf32_pjl_vec; 544 560 extern const bfd_target bfd_elf32_powerpc_vec; 545 561 extern const bfd_target bfd_elf32_powerpcle_vec; 562 extern const bfd_target bfd_elf32_s390_vec; 563 extern const bfd_target bfd_elf32_sh64_vec; 564 extern const bfd_target bfd_elf32_sh64l_vec; 565 extern const bfd_target bfd_elf32_sh64lin_vec; 566 extern const bfd_target bfd_elf32_sh64blin_vec; 567 extern const bfd_target bfd_elf32_sh64lnbsd_vec; 568 extern const bfd_target bfd_elf32_sh64nbsd_vec; 546 569 extern const bfd_target bfd_elf32_sh_vec; 547 570 extern const bfd_target bfd_elf32_shblin_vec; 548 571 extern const bfd_target bfd_elf32_shl_vec; 549 572 extern const bfd_target bfd_elf32_shlin_vec; 573 extern const bfd_target bfd_elf32_shlnbsd_vec; 574 extern const bfd_target bfd_elf32_shnbsd_vec; 550 575 extern const bfd_target bfd_elf32_sparc_vec; 551 576 extern const bfd_target bfd_elf32_tradbigmips_vec; … … 553 578 extern const bfd_target bfd_elf32_us_cris_vec; 554 579 extern const bfd_target bfd_elf32_v850_vec; 580 extern const bfd_target bfd_elf32_vax_vec; 581 extern const bfd_target bfd_elf32_xstormy16_vec; 582 extern const bfd_target bfd_elf32_xtensa_be_vec; 583 extern const bfd_target bfd_elf32_xtensa_le_vec; 584 extern const bfd_target bfd_elf64_alpha_freebsd_vec; 555 585 extern const bfd_target bfd_elf64_alpha_vec; 556 586 extern const bfd_target bfd_elf64_big_generic_vec; … … 558 588 extern const bfd_target bfd_elf64_hppa_linux_vec; 559 589 extern const bfd_target bfd_elf64_hppa_vec; 590 extern const bfd_target bfd_elf64_ia64_aix_big_vec; 591 extern const bfd_target bfd_elf64_ia64_aix_little_vec; 560 592 extern const bfd_target bfd_elf64_ia64_big_vec; 593 extern const bfd_target bfd_elf64_ia64_hpux_big_vec; 561 594 extern const bfd_target bfd_elf64_ia64_little_vec; 562 595 extern const bfd_target bfd_elf64_little_generic_vec; 563 596 extern const bfd_target bfd_elf64_littlemips_vec; 597 extern const bfd_target bfd_elf64_mmix_vec; 598 extern const bfd_target bfd_elf64_powerpc_vec; 599 extern const bfd_target bfd_elf64_powerpcle_vec; 600 extern const bfd_target bfd_elf64_s390_vec; 601 extern const bfd_target bfd_elf64_sh64_vec; 602 extern const bfd_target bfd_elf64_sh64l_vec; 603 extern const bfd_target bfd_elf64_sh64lin_vec; 604 extern const bfd_target bfd_elf64_sh64blin_vec; 605 extern const bfd_target bfd_elf64_sh64lnbsd_vec; 606 extern const bfd_target bfd_elf64_sh64nbsd_vec; 607 extern const bfd_target bfd_elf64_sparc_vec; 564 608 extern const bfd_target bfd_elf64_tradbigmips_vec; 565 609 extern const bfd_target bfd_elf64_tradlittlemips_vec; 566 extern const bfd_target bfd_elf64_sparc_vec;567 610 extern const bfd_target bfd_elf64_x86_64_vec; 611 extern const bfd_target bfd_mmo_vec; 568 612 extern const bfd_target bfd_powerpc_pe_vec; 569 613 extern const bfd_target bfd_powerpc_pei_vec; … … 613 657 extern const bfd_target m88kbcs_vec; 614 658 extern const bfd_target m88kmach3_vec; 659 extern const bfd_target mach_o_be_vec; 660 extern const bfd_target mach_o_le_vec; 661 extern const bfd_target mach_o_fat_vec; 615 662 extern const bfd_target mcore_pe_big_vec; 616 663 extern const bfd_target mcore_pe_little_vec; … … 625 672 extern const bfd_target nlm32_sparc_vec; 626 673 extern const bfd_target oasys_vec; 674 extern const bfd_target or32coff_big_vec; 627 675 extern const bfd_target pc532machaout_vec; 628 676 extern const bfd_target pc532netbsd_vec; 677 extern const bfd_target pdp11_aout_vec; 678 extern const bfd_target pef_vec; 679 extern const bfd_target pef_xlib_vec; 629 680 extern const bfd_target pmac_xcoff_vec; 630 681 extern const bfd_target ppcboot_vec; … … 646 697 extern const bfd_target sparcnetbsd_vec; 647 698 extern const bfd_target sunos_big_vec; 648 extern const bfd_target tekhex_vec;699 extern const bfd_target sym_vec; 649 700 extern const bfd_target tic30_aout_vec; 650 701 extern const bfd_target tic30_coff_vec; 702 extern const bfd_target tic4x_coff0_beh_vec; 703 extern const bfd_target tic4x_coff0_vec; 704 extern const bfd_target tic4x_coff1_beh_vec; 705 extern const bfd_target tic4x_coff1_vec; 706 extern const bfd_target tic4x_coff2_beh_vec; 707 extern const bfd_target tic4x_coff2_vec; 651 708 extern const bfd_target tic54x_coff0_beh_vec; 652 709 extern const bfd_target tic54x_coff0_vec; … … 656 713 extern const bfd_target tic54x_coff2_vec; 657 714 extern const bfd_target tic80coff_vec; 715 extern const bfd_target vaxbsd_vec; 658 716 extern const bfd_target vaxnetbsd_vec; 717 extern const bfd_target vax1knetbsd_vec; 659 718 extern const bfd_target versados_vec; 660 719 extern const bfd_target vms_alpha_vec; … … 664 723 extern const bfd_target z8kcoff_vec; 665 724 666 /* srec isalways included. */725 /* These are always included. */ 667 726 extern const bfd_target srec_vec; 668 727 extern const bfd_target symbolsrec_vec; 669 670 /* binary is always included. */ 728 extern const bfd_target tekhex_vec; 671 729 extern const bfd_target binary_vec; 672 673 /* ihex is always included. */674 730 extern const bfd_target ihex_vec; 675 731 … … 678 734 extern const bfd_target cisco_core_big_vec; 679 735 extern const bfd_target cisco_core_little_vec; 736 extern const bfd_target hppabsd_core_vec; 680 737 extern const bfd_target hpux_core_vec; 681 extern const bfd_target hppabsd_core_vec;682 738 extern const bfd_target irix_core_vec; 683 739 extern const bfd_target netbsd_core_vec; 684 740 extern const bfd_target osf_core_vec; 741 extern const bfd_target ptrace_core_vec; 685 742 extern const bfd_target sco5_core_vec; 686 743 extern const bfd_target trad_core_vec; 687 extern const bfd_target ptrace_core_vec;688 744 689 745 static const bfd_target * const _bfd_target_vector[] = { … … 706 762 &a29kcoff_big_vec, 707 763 &a_out_adobe_vec, 708 #if 0 /* No one seems to use this. */ 764 #ifdef BFD64 765 &aix5coff64_vec, 766 #endif 767 &aout0_big_vec, 768 #if 0 769 /* We have no way of distinguishing these from other a.out variants. */ 770 &aout_arm_big_vec, 771 &aout_arm_little_vec, 772 /* No one seems to use this. */ 709 773 &aout_mips_big_vec, 710 774 #endif 711 775 &aout_mips_little_vec, 776 #if 0 777 &apollocoff_vec, 778 #endif 779 &arm_epoc_pe_big_vec, 780 &arm_epoc_pe_little_vec, 781 &arm_epoc_pei_big_vec, 782 &arm_epoc_pei_little_vec, 783 &armcoff_big_vec, 784 &armcoff_little_vec, 785 &armnetbsd_vec, 786 &armpe_big_vec, 787 &armpe_little_vec, 788 &armpei_big_vec, 789 &armpei_little_vec, 712 790 &b_out_vec_big_host, 713 791 &b_out_vec_little_host, 714 715 792 &bfd_efi_app_ia32_vec, 716 793 #ifdef BFD64 717 794 &bfd_efi_app_ia64_vec, 718 795 #endif 796 &bfd_elf32_avr_vec, 719 797 720 798 /* This, and other vectors, may not be used in any *.mt configuration. … … 723 801 the file even if we don't recognize the machine type. */ 724 802 &bfd_elf32_big_generic_vec, 725 #ifdef BFD64726 &bfd_elf64_alpha_vec,727 &bfd_elf64_hppa_vec,728 &bfd_elf64_hppa_linux_vec,729 &bfd_elf64_ia64_little_vec,730 &bfd_elf64_ia64_big_vec,731 #endif732 &bfd_elf32_avr_vec,733 803 &bfd_elf32_bigarc_vec, 734 &bfd_elf32_bigarm_vec,735 &bfd_elf32_bigarm_oabi_vec,804 &bfd_elf32_bigarm_oabi_vec, 805 &bfd_elf32_bigarm_vec, 736 806 &bfd_elf32_bigmips_vec, 737 #ifdef BFD64738 &bfd_elf64_bigmips_vec,739 #endif740 807 &bfd_elf32_cris_vec, 741 &bfd_elf32_us_cris_vec,742 808 &bfd_elf32_d10v_vec, 743 809 &bfd_elf32_d30v_vec, 810 &bfd_elf32_dlx_big_vec, 811 &bfd_elf32_fr30_vec, 812 &bfd_elf32_frv_vec, 813 &bfd_elf32_h8300_vec, 814 &bfd_elf32_hppa_linux_vec, 744 815 &bfd_elf32_hppa_vec, 745 &bfd_elf32_hppa_linux_vec,746 816 &bfd_elf32_i370_vec, 817 &bfd_elf32_i386_freebsd_vec, 747 818 &bfd_elf32_i386_vec, 748 #ifdef BFD64 749 &bfd_elf64_x86_64_vec, 750 #endif 819 &bfd_elf32_i860_little_vec, 751 820 &bfd_elf32_i860_vec, 752 &bfd_elf32_i860_little_vec,753 821 &bfd_elf32_i960_vec, 822 #if 0 823 &bfd_elf32_ia64_big_vec, 824 #endif 825 &bfd_elf32_ia64_hpux_big_vec, 826 &bfd_elf32_ip2k_vec, 827 &bfd_elf32_iq2000_vec, 754 828 &bfd_elf32_little_generic_vec, 755 829 &bfd_elf32_littlearc_vec, 756 &bfd_elf32_littlearm_vec,757 &bfd_elf32_littlearm_oabi_vec,830 &bfd_elf32_littlearm_oabi_vec, 831 &bfd_elf32_littlearm_vec, 758 832 &bfd_elf32_littlemips_vec, 759 #ifdef BFD64760 &bfd_elf64_littlemips_vec,761 #endif762 833 &bfd_elf32_m32r_vec, 763 &bfd_elf32_mn10200_vec,764 &bfd_elf32_mn10300_vec,765 834 &bfd_elf32_m68hc11_vec, 766 835 &bfd_elf32_m68hc12_vec, 767 836 &bfd_elf32_m68k_vec, 768 837 &bfd_elf32_m88k_vec, 838 &bfd_elf32_mcore_big_vec, 839 &bfd_elf32_mcore_little_vec, 840 &bfd_elf32_mn10200_vec, 841 &bfd_elf32_mn10300_vec, 842 &bfd_elf32_msp430_vec, 843 #ifdef BFD64 844 &bfd_elf32_nbigmips_vec, 845 &bfd_elf32_nlittlemips_vec, 846 &bfd_elf32_ntradbigmips_vec, 847 &bfd_elf32_ntradlittlemips_vec, 848 #endif 849 &bfd_elf32_openrisc_vec, 850 &bfd_elf32_or32_big_vec, 769 851 &bfd_elf32_pj_vec, 770 852 &bfd_elf32_pjl_vec, 771 853 &bfd_elf32_powerpc_vec, 772 854 &bfd_elf32_powerpcle_vec, 855 &bfd_elf32_s390_vec, 856 &bfd_elf32_sh_vec, 857 &bfd_elf32_shblin_vec, 858 &bfd_elf32_shl_vec, 859 &bfd_elf32_shlin_vec, 860 &bfd_elf32_shlnbsd_vec, 861 &bfd_elf32_shnbsd_vec, 862 #ifdef BFD64 863 &bfd_elf32_sh64_vec, 864 &bfd_elf32_sh64l_vec, 865 &bfd_elf32_sh64lnbsd_vec, 866 &bfd_elf32_sh64nbsd_vec, 867 &bfd_elf32_sh64lin_vec, 868 &bfd_elf32_sh64blin_vec, 869 #endif 773 870 &bfd_elf32_sparc_vec, 774 &bfd_elf32_v850_vec,775 &bfd_elf32_fr30_vec,776 &bfd_elf32_mcore_big_vec,777 &bfd_elf32_mcore_little_vec,778 871 &bfd_elf32_tradbigmips_vec, 779 872 &bfd_elf32_tradlittlemips_vec, 873 &bfd_elf32_us_cris_vec, 874 &bfd_elf32_v850_vec, 875 &bfd_elf32_vax_vec, 876 &bfd_elf32_xstormy16_vec, 877 &bfd_elf32_xtensa_be_vec, 878 &bfd_elf32_xtensa_le_vec, 780 879 #ifdef BFD64 880 &bfd_elf64_alpha_freebsd_vec, 881 &bfd_elf64_alpha_vec, 882 &bfd_elf64_big_generic_vec, 883 &bfd_elf64_bigmips_vec, 884 &bfd_elf64_hppa_linux_vec, 885 &bfd_elf64_hppa_vec, 886 &bfd_elf64_ia64_aix_big_vec, 887 &bfd_elf64_ia64_aix_little_vec, 888 &bfd_elf64_ia64_big_vec, 889 &bfd_elf64_ia64_hpux_big_vec, 890 &bfd_elf64_ia64_little_vec, 891 &bfd_elf64_little_generic_vec, 892 &bfd_elf64_littlemips_vec, 893 &bfd_elf64_mmix_vec, 894 &bfd_elf64_powerpc_vec, 895 &bfd_elf64_powerpcle_vec, 896 &bfd_elf64_s390_vec, 897 &bfd_elf64_sh64_vec, 898 &bfd_elf64_sh64l_vec, 899 &bfd_elf64_sh64lnbsd_vec, 900 &bfd_elf64_sh64nbsd_vec, 901 &bfd_elf64_sh64lin_vec, 902 &bfd_elf64_sh64blin_vec, 903 #if 0 904 &bfd_elf64_sparc_vec, 905 #endif 781 906 &bfd_elf64_tradbigmips_vec, 782 907 &bfd_elf64_tradlittlemips_vec, 783 /* No one seems to use this. */ 784 &bfd_elf64_big_generic_vec, 785 &bfd_elf64_little_generic_vec, 786 #endif 787 #if 0 788 &bfd_elf64_sparc_vec, 789 #endif 790 /* We don't include cisco_core_*_vec. Although it has a magic number, 791 the magic number isn't at the beginning of the file, and thus 792 might spuriously match other kinds of files. */ 793 794 &cris_aout_vec, 908 &bfd_elf64_x86_64_vec, 909 &bfd_mmo_vec, 910 #endif 911 &bfd_powerpc_pe_vec, 912 &bfd_powerpc_pei_vec, 913 &bfd_powerpcle_pe_vec, 914 &bfd_powerpcle_pei_vec, 915 &cris_aout_vec, 795 916 #ifdef BFD64 796 &demo_64_vec, /* Only compiled if host has long-long support */917 &demo_64_vec, /* Only compiled if host has long-long support. */ 797 918 #endif 798 919 &ecoff_big_vec, 920 &ecoff_biglittle_vec, 799 921 &ecoff_little_vec, 800 &ecoff_biglittle_vec,801 922 #ifdef BFD64 802 923 &ecoffalpha_little_vec, 803 924 #endif 925 &go32coff_vec, 926 &go32stubbedcoff_vec, 804 927 &h8300coff_vec, 805 928 &h8500coff_vec, … … 808 931 which kind of a.out file it is. */ 809 932 &host_aout_vec, 810 #endif 811 #if 0 /* Clashes with sunos_big_vec magic no. */ 933 /* Clashes with sunos_big_vec magic no. */ 812 934 &hp300bsd_vec, 813 935 #endif 814 936 &hp300hpux_vec, 815 #if defined (HOST_HPPAHPUX) || defined (HOST_HPPABSD) || defined (HOST_HPPAOSF)816 &som_vec,817 #endif818 937 &i386aout_vec, 819 938 &i386bsd_vec, 820 939 &i386coff_vec, 940 #if 0 941 &i386dynix_vec, 942 #endif 821 943 &i386freebsd_vec, 822 &i860coff_vec,823 &bfd_powerpc_pe_vec,824 &bfd_powerpcle_pe_vec,825 &bfd_powerpc_pei_vec,826 &bfd_powerpcle_pei_vec,827 &go32coff_vec,828 &go32stubbedcoff_vec,829 944 #if 0 830 945 /* Since a.out files lack decent magic numbers, no way to recognize … … 843 958 &i386pe_vec, 844 959 &i386pei_vec, 845 &armcoff_little_vec, 846 &armcoff_big_vec, 847 &armnetbsd_vec, 848 &armpe_little_vec, 849 &armpe_big_vec, 850 &armpei_little_vec, 851 &armpei_big_vec, 852 &arm_epoc_pe_little_vec, 853 &arm_epoc_pe_big_vec, 854 &arm_epoc_pei_little_vec, 855 &arm_epoc_pei_big_vec, 960 &i860coff_vec, 856 961 &icoff_big_vec, 857 962 &icoff_little_vec, 858 963 &ieee_vec, 964 #if 0 965 &m68k4knetbsd_vec, 966 &m68kaux_coff_vec, 967 #endif 859 968 &m68kcoff_vec, 860 969 &m68kcoffun_vec, … … 870 979 &m88kbcs_vec, 871 980 &m88kmach3_vec, 981 &mach_o_be_vec, 982 &mach_o_le_vec, 983 &mach_o_fat_vec, 872 984 &mcore_pe_big_vec, 873 985 &mcore_pe_little_vec, 874 986 &mcore_pei_big_vec, 875 987 &mcore_pei_little_vec, 988 &mipslpe_vec, 989 &mipslpei_vec, 876 990 &newsos3_vec, 877 &nlm32_i386_vec,878 &nlm32_sparc_vec,879 991 #ifdef BFD64 880 992 &nlm32_alpha_vec, 881 993 #endif 882 &pc532netbsd_vec, 994 &nlm32_i386_vec, 995 &nlm32_powerpc_vec, 996 &nlm32_sparc_vec, 883 997 #if 0 884 998 /* We have no oasys tools anymore, so we can't test any of this … … 889 1003 &oasys_vec, 890 1004 #endif 1005 /* Entry for the OpenRISC family. */ 1006 &or32coff_big_vec, 1007 891 1008 &pc532machaout_vec, 892 #if 0 893 /* We have no way of distinguishing these from other a.out variants */ 894 &aout_arm_big_vec, 895 &aout_arm_little_vec, 896 &riscix_vec, 897 #endif 1009 &pc532netbsd_vec, 1010 &pdp11_aout_vec, 1011 &pef_vec, 1012 &pef_xlib_vec, 898 1013 #if 0 899 1014 /* This has the same magic number as RS/6000. */ 900 1015 &pmac_xcoff_vec, 901 1016 #endif 902 &rs6000coff_vec, 1017 &ppcboot_vec, 1018 #if 0 1019 /* We have no way of distinguishing these from other a.out variants. */ 1020 &riscix_vec, 1021 #endif 903 1022 #ifdef BFD64 904 1023 &rs6000coff64_vec, 905 1024 #endif 906 &ppcboot_vec, 1025 &rs6000coff_vec, 1026 &shcoff_small_vec, 907 1027 &shcoff_vec, 1028 &shlcoff_small_vec, 908 1029 &shlcoff_vec, 909 &shcoff_small_vec, 910 &shlcoff_small_vec, 1030 &shlpe_vec, 1031 &shlpei_vec, 1032 #if defined (HOST_HPPAHPUX) || defined (HOST_HPPABSD) || defined (HOST_HPPAOSF) 1033 &som_vec, 1034 #endif 1035 &sparccoff_vec, 911 1036 &sparcle_aout_vec, 912 1037 &sparclinux_vec, … … 915 1040 &sparcnetbsd_vec, 916 1041 &sunos_big_vec, 917 & aout0_big_vec,1042 &sym_vec, 918 1043 &tic30_aout_vec, 919 1044 &tic30_coff_vec, 1045 &tic54x_coff0_beh_vec, 920 1046 &tic54x_coff0_vec, 921 &tic54x_coff 0_beh_vec,1047 &tic54x_coff1_beh_vec, 922 1048 &tic54x_coff1_vec, 923 &tic54x_coff 1_beh_vec,1049 &tic54x_coff2_beh_vec, 924 1050 &tic54x_coff2_vec, 925 &tic54x_coff2_beh_vec,926 1051 &tic80coff_vec, 1052 &vaxbsd_vec, 927 1053 &vaxnetbsd_vec, 1054 &vax1knetbsd_vec, 928 1055 &versados_vec, 929 1056 #ifdef BFD64 … … 931 1058 #endif 932 1059 &vms_vax_vec, 1060 &w65_vec, 933 1061 &we32kcoff_vec, 934 1062 &z8kcoff_vec, 935 936 1063 #endif /* not SELECT_VECS */ 937 1064 … … 951 1078 &aix386_core_vec, 952 1079 #endif 1080 #if 0 1081 /* We don't include cisco_core_*_vec. Although it has a magic number, 1082 the magic number isn't at the beginning of the file, and thus 1083 might spuriously match other kinds of files. */ 1084 &cisco_core_big_vec, 1085 &cisco_core_little_vec, 1086 #endif 1087 #ifdef HPPABSD_CORE 1088 &hppabsd_core_vec, 1089 #endif 953 1090 #ifdef HPUX_CORE 954 1091 &hpux_core_vec, 955 1092 #endif 956 #ifdef HPPABSD_CORE957 &hppabsd_core_vec,958 #endif959 1093 #ifdef IRIX_CORE 960 1094 &irix_core_vec, … … 966 1100 &osf_core_vec, 967 1101 #endif 1102 #ifdef PTRACE_CORE 1103 &ptrace_core_vec, 1104 #endif 968 1105 #ifdef SCO5_CORE 969 1106 &sco5_core_vec, 970 1107 #endif 971 #ifdef 1108 #ifdef TRAD_CORE 972 1109 &trad_core_vec, 973 #endif974 975 #ifdef PTRACE_CORE976 &ptrace_core_vec,977 1110 #endif 978 1111 … … 990 1123 NULL 991 1124 }; 1125 1126 /* bfd_associated_vector[] contains the associated target vectors used 1127 to reduce the ambiguity in bfd_check_format_matches. */ 1128 1129 static const bfd_target *_bfd_associated_vector[] = { 1130 #ifdef ASSOCIATED_VECS 1131 ASSOCIATED_VECS, 1132 #endif 1133 NULL 1134 }; 1135 const bfd_target * const *bfd_associated_vector = _bfd_associated_vector; 992 1136 993 1137 /* When there is an ambiguous match, bfd_check_format_matches puts the … … 1053 1197 1054 1198 SYNOPSIS 1055 b oolean bfd_set_default_target (const char *name);1199 bfd_boolean bfd_set_default_target (const char *name); 1056 1200 1057 1201 DESCRIPTION … … 1061 1205 */ 1062 1206 1063 b oolean1207 bfd_boolean 1064 1208 bfd_set_default_target (name) 1065 1209 const char *name; … … 1069 1213 if (bfd_default_vector[0] != NULL 1070 1214 && strcmp (name, bfd_default_vector[0]->name) == 0) 1071 return true;1215 return TRUE; 1072 1216 1073 1217 target = find_target (name); 1074 1218 if (target == NULL) 1075 return false;1219 return FALSE; 1076 1220 1077 1221 bfd_default_vector[0] = target; 1078 return true;1222 return TRUE; 1079 1223 } 1080 1224 … … 1084 1228 1085 1229 SYNOPSIS 1086 const bfd_target *bfd_find_target (CONSTchar *target_name, bfd *abfd);1230 const bfd_target *bfd_find_target (const char *target_name, bfd *abfd); 1087 1231 1088 1232 DESCRIPTION … … 1111 1255 targname = getenv ("GNUTARGET"); 1112 1256 1113 /* This is safe; the vector cannot be null */1257 /* This is safe; the vector cannot be null. */ 1114 1258 if (targname == NULL || strcmp (targname, "default") == 0) 1115 1259 { 1116 abfd->target_defaulted = true;1260 abfd->target_defaulted = TRUE; 1117 1261 if (bfd_default_vector[0] != NULL) 1118 1262 abfd->xvec = bfd_default_vector[0]; … … 1122 1266 } 1123 1267 1124 abfd->target_defaulted = false;1268 abfd->target_defaulted = FALSE; 1125 1269 1126 1270 target = find_target (targname); … … 1137 1281 1138 1282 SYNOPSIS 1139 const char ** bfd_target_list(void);1283 const char ** bfd_target_list (void); 1140 1284 1141 1285 DESCRIPTION … … 1150 1294 { 1151 1295 int vec_length= 0; 1296 bfd_size_type amt; 1152 1297 #if defined (HOST_HPPAHPUX) && ! defined (__STDC__) 1153 1298 /* The native compiler on the HP9000/700 has a bug which causes it … … 1155 1300 volatile 1156 1301 #endif 1157 1158 CONSTchar **name_list, **name_ptr;1302 const bfd_target * const *target; 1303 const char **name_list, **name_ptr; 1159 1304 1160 1305 for (target = &bfd_target_vector[0]; *target != NULL; target++) 1161 1306 vec_length++; 1162 1307 1163 name_ptr = name_list = (CONST char **)1164 bfd_zmalloc ((vec_length + 1) * sizeof (char **));1308 amt = (vec_length + 1) * sizeof (char **); 1309 name_ptr = name_list = (const char **) bfd_malloc (amt); 1165 1310 1166 1311 if (name_list == NULL) … … 1168 1313 1169 1314 for (target = &bfd_target_vector[0]; *target != NULL; target++) 1170 *(name_ptr++) = (*target)->name; 1171 1315 if (target == &bfd_target_vector[0] 1316 || *target != bfd_target_vector[0]) 1317 *name_ptr++ = (*target)->name; 1318 1319 *name_ptr = NULL; 1172 1320 return name_list; 1173 1321 } … … 1178 1326 1179 1327 SYNOPSIS 1180 const bfd_target * bfd_search_for_target (int (* search_func) (const bfd_target *, void *), void *); 1328 const bfd_target * bfd_search_for_target (int (* search_func) 1329 (const bfd_target *, void *), 1330 void *); 1181 1331 1182 1332 DESCRIPTION -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/binutils/bfd/trad-core.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r617 r618 1 1 /* BFD back end for traditional Unix core files (U-area and raw sections) 2 2 Copyright 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 3 2000 3 2000, 2001, 2002 4 4 Free Software Foundation, Inc. 5 5 Written by John Gilmore of Cygnus Support. … … 44 44 #include <sys/user.h> /* After a.out.h */ 45 45 46 #ifndef __EMX__ /* r=bird: Code was initially removed. Is this __EMX__ or EMX 47 * and why don't we include it? anything to do with sysdep.h? */ 46 #ifndef __EMX__ /* r=bird: Code was initially removed. Why don't we include it? anything to do with sysdep.h? */ 48 47 #ifdef TRAD_HEADER 49 48 #include TRAD_HEADER … … 51 50 #endif /* !__EMX__ */ 52 51 53 54 55 56 #ifdef __EMX__ /* r=bird: Isn't this a EMX (target) thing? */57 58 #endif /* __EMX__*/59 60 61 62 52 struct trad_core_struct 53 { 54 asection *data_section; 55 #ifdef EMX 56 asection *heap_section; 57 #endif /* EMX */ 58 asection *stack_section; 59 asection *reg_section; 60 struct user u; 61 }; 63 62 64 63 #define core_upage(bfd) (&((bfd)->tdata.trad_core_data->u)) 65 64 #define core_datasec(bfd) ((bfd)->tdata.trad_core_data->data_section) 66 #ifdef __EMX__ /* r=bird: Isn't this a EMX (target) thing? */65 #ifdef EMX 67 66 #define core_heapsec(bfd) ((bfd)->tdata.trad_core_data->heap_section) 68 #endif /* __EMX__*/67 #endif /* EMX */ 69 68 #define core_stacksec(bfd) ((bfd)->tdata.trad_core_data->stack_section) 70 69 #define core_regsec(bfd) ((bfd)->tdata.trad_core_data->reg_section) … … 73 72 74 73 const bfd_target *trad_unix_core_file_p PARAMS ((bfd *abfd)); 75 char * 76 int 77 b ooleantrad_unix_core_file_matches_executable_p78 79 static void 74 char * trad_unix_core_file_failing_command PARAMS ((bfd *abfd)); 75 int trad_unix_core_file_failing_signal PARAMS ((bfd *abfd)); 76 bfd_boolean trad_unix_core_file_matches_executable_p 77 PARAMS ((bfd *core_bfd, bfd *exec_bfd)); 78 static void swap_abort PARAMS ((void)); 80 79 81 80 /* Handle 4.2-style (and perhaps also sysV-style) core dump file. */ … … 90 89 struct user u; 91 90 struct trad_core_struct *rawptr; 91 bfd_size_type amt; 92 92 93 93 #ifdef TRAD_CORE_USER_OFFSET 94 94 /* If defined, this macro is the file position of the user struct. */ 95 if (bfd_seek (abfd, TRAD_CORE_USER_OFFSET, SEEK_SET) != 0)95 if (bfd_seek (abfd, (file_ptr) TRAD_CORE_USER_OFFSET, SEEK_SET) != 0) 96 96 return 0; 97 97 #endif 98 98 99 val = bfd_ read ((void *)&u, 1,sizeof u, abfd);99 val = bfd_bread ((void *) &u, (bfd_size_type) sizeof u, abfd); 100 100 if (val != sizeof u) 101 101 { … … 106 106 107 107 /* Sanity check perhaps??? */ 108 #ifdef __EMX__ /* r=bird: Target (EMX) as well? */108 #ifdef __EMX__ /* r=bird: EMX not __EMX__ thing?? */ 109 109 if (u.u_magic != UMAGIC) 110 110 return 0; … … 164 164 /* Allocate both the upage and the struct core_data at once, so 165 165 a single free() will free them both. */ 166 rawptr = (struct trad_core_struct *)167 bfd_zmalloc (sizeof (struct trad_core_struct));166 amt = sizeof (struct trad_core_struct); 167 rawptr = (struct trad_core_struct *) bfd_zmalloc (amt); 168 168 if (rawptr == NULL) 169 169 return 0; … … 173 173 rawptr->u = u; /*Copy the uarea into the tdata part of the bfd */ 174 174 175 /* Create the sections. This is raunchy, but bfd_close wants to free 176 them separately. */ 177 178 core_stacksec(abfd) = (asection *) bfd_zalloc (abfd, sizeof (asection)); 175 /* Create the sections. */ 176 177 core_stacksec(abfd) = bfd_make_section_anyway (abfd, ".stack"); 179 178 if (core_stacksec (abfd) == NULL) 180 return NULL;181 core_datasec (abfd) = (asection *) bfd_zalloc (abfd, sizeof (asection));179 goto fail; 180 core_datasec (abfd) = bfd_make_section_anyway (abfd, ".data"); 182 181 if (core_datasec (abfd) == NULL) 183 return NULL;184 core_regsec (abfd) = (asection *) bfd_zalloc (abfd, sizeof (asection));182 goto fail; 183 core_regsec (abfd) = bfd_make_section_anyway (abfd, ".reg"); 185 184 if (core_regsec (abfd) == NULL) 186 return NULL;187 #ifdef EMX 188 core_heapsec (abfd) = (asection *) bfd_zmalloc (sizeof (asection));185 goto fail; 186 #ifdef EMX 187 core_heapsec (abfd) = bfd_make_section_anyway (abfd, ".heap"); 189 188 if (core_heapsec (abfd) == NULL) 190 return NULL;189 goto fail; 191 190 #endif /* EMX */ 192 191 … … 254 253 of the section to -u_ar0). GDB uses this info to locate the regs, 255 254 using minor trickery to get around the offset-or-absolute-addr problem. */ 256 core_regsec (abfd)->vma = - (bfd_vma) u.u_ar0;255 core_regsec (abfd)->vma = - (bfd_vma) (unsigned long) u.u_ar0; 257 256 258 257 #ifdef EMX … … 279 278 core_regsec (abfd)->alignment_power = 2; 280 279 281 abfd->sections = core_stacksec (abfd);282 core_stacksec (abfd)->next = core_datasec (abfd);283 #ifdef EMX284 core_datasec (abfd)->next = core_heapsec (abfd);285 core_heapsec (abfd)->next = core_regsec (abfd);286 abfd->section_count = 4;287 #else /* not EMX */288 core_datasec (abfd)->next = core_regsec (abfd);289 abfd->section_count = 3;290 #endif /* not EMX */291 292 280 return abfd->xvec; 281 282 fail: 283 bfd_release (abfd, abfd->tdata.any); 284 abfd->tdata.any = NULL; 285 bfd_section_list_clear (abfd); 286 return NULL; 293 287 } 294 288 … … 319 313 320 314 /* ARGSUSED */ 321 b oolean315 bfd_boolean 322 316 trad_unix_core_file_matches_executable_p (core_bfd, exec_bfd) 323 317 bfd *core_bfd ATTRIBUTE_UNUSED; 324 318 bfd *exec_bfd ATTRIBUTE_UNUSED; 325 319 { 326 return true; /* FIXME, We have no way of telling at this point */320 return TRUE; /* FIXME, We have no way of telling at this point */ 327 321 } 328 322 -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.