Changeset 618 for trunk/src/binutils/bfd/aoutx.h
- Timestamp:
- Aug 16, 2003, 11:33:53 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note:
See TracChangeset
for help on using the changeset viewer.