Changeset 609 for branches/GNU/src/binutils/bfd/ecofflink.c
- Timestamp:
- Aug 16, 2003, 6:59:22 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GNU/src/binutils/bfd/ecofflink.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 1 /* Routines to link ECOFF debugging information. 2 Copyright 1993, 1994, 1995, 1996, 1997, 2000 2 Copyright 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2002 3 3 Free Software Foundation, Inc. 4 4 Written by Ian Lance Taylor, Cygnus Support, <ian@cygnus.com>. 5 5 6 This file is part of BFD, the Binary File Descriptor library.7 8 This program is free software; you can redistribute it and/or modify9 it under the terms of the GNU General Public License as published by10 the Free Software Foundation; either version 2 of the License, or11 (at your option) any later version.12 13 This program is distributed in the hope that it will be useful,14 but WITHOUT ANY WARRANTY; without even the implied warranty of15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the16 GNU General Public License for more details.17 18 You should have received a copy of the GNU General Public License19 along with this program; if not, write to the Free Software20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */6 This file is part of BFD, the Binary File Descriptor library. 7 8 This program is free software; you can redistribute it and/or modify 9 it under the terms of the GNU General Public License as published by 10 the Free Software Foundation; either version 2 of the License, or 11 (at your option) any later version. 12 13 This program is distributed in the hope that it will be useful, 14 but WITHOUT ANY WARRANTY; without even the implied warranty of 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 GNU General Public License for more details. 17 18 You should have received a copy of the GNU General Public License 19 along with this program; if not, write to the Free Software 20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 21 21 22 22 #include "bfd.h" … … 34 34 35 35 36 static b oolean ecoff_add_bytes PARAMS ((char **buf, char **bufend,37 36 static bfd_boolean ecoff_add_bytes 37 PARAMS ((char **buf, char **bufend, size_t need)); 38 38 static struct bfd_hash_entry *string_hash_newfunc 39 39 PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, 40 40 const char *)); 41 static void ecoff_align_debug PARAMS ((bfd *abfd, 42 struct ecoff_debug_info *debug, 43 const struct ecoff_debug_swap *swap)); 44 static boolean ecoff_write_symhdr PARAMS ((bfd *, struct ecoff_debug_info *, 45 const struct ecoff_debug_swap *, 46 file_ptr where)); 47 static int cmp_fdrtab_entry PARAMS ((const PTR, const PTR)); 48 static boolean mk_fdrtab PARAMS ((bfd *, 49 struct ecoff_debug_info * const, 50 const struct ecoff_debug_swap * const, 51 struct ecoff_find_line *)); 52 static long fdrtab_lookup PARAMS ((struct ecoff_find_line *, bfd_vma)); 53 static boolean lookup_line 41 static void ecoff_align_debug 42 PARAMS ((bfd *abfd, struct ecoff_debug_info *debug, 43 const struct ecoff_debug_swap *swap)); 44 static bfd_boolean ecoff_write_symhdr 45 PARAMS ((bfd *, struct ecoff_debug_info *, const struct ecoff_debug_swap *, 46 file_ptr where)); 47 static int cmp_fdrtab_entry 48 PARAMS ((const PTR, const PTR)); 49 static bfd_boolean mk_fdrtab 50 PARAMS ((bfd *, struct ecoff_debug_info * const, 51 const struct ecoff_debug_swap * const, struct ecoff_find_line *)); 52 static long fdrtab_lookup 53 PARAMS ((struct ecoff_find_line *, bfd_vma)); 54 static bfd_boolean lookup_line 54 55 PARAMS ((bfd *, struct ecoff_debug_info * const, 55 56 const struct ecoff_debug_swap * const, struct ecoff_find_line *)); … … 257 258 /* Add bytes to a buffer. Return success. */ 258 259 259 static b oolean260 static bfd_boolean 260 261 ecoff_add_bytes (buf, bufend, need) 261 262 char **buf; … … 276 277 want = ALLOC_SIZE; 277 278 } 278 newbuf = (char *) bfd_realloc (*buf, have + want);279 newbuf = (char *) bfd_realloc (*buf, (bfd_size_type) have + want); 279 280 if (newbuf == NULL) 280 return false;281 return FALSE; 281 282 *buf = newbuf; 282 283 *bufend = *buf + have + want; 283 return true;284 return TRUE; 284 285 } 285 286 … … 351 352 unsigned long size; 352 353 /* Whether this information comes from a file or not. */ 353 b oolean filep;354 bfd_boolean filep; 354 355 union 355 356 { … … 404 405 /* Add a file entry to a shuffle list. */ 405 406 406 static boolean add_file_shuffle PARAMS ((struct accumulate *, 407 struct shuffle **, 408 struct shuffle **, bfd *, file_ptr, 409 unsigned long)); 410 411 static boolean 407 static bfd_boolean add_file_shuffle 408 PARAMS ((struct accumulate *, struct shuffle **, struct shuffle **, 409 bfd *, file_ptr, unsigned long)); 410 411 static bfd_boolean 412 412 add_file_shuffle (ainfo, head, tail, input_bfd, offset, size) 413 413 struct accumulate *ainfo; … … 429 429 if ((*tail)->size > ainfo->largest_file_shuffle) 430 430 ainfo->largest_file_shuffle = (*tail)->size; 431 return true;431 return TRUE; 432 432 } 433 433 … … 437 437 { 438 438 bfd_set_error (bfd_error_no_memory); 439 return false;439 return FALSE; 440 440 } 441 441 n->next = NULL; 442 442 n->size = size; 443 n->filep = true;443 n->filep = TRUE; 444 444 n->u.file.input_bfd = input_bfd; 445 445 n->u.file.offset = offset; … … 451 451 if (size > ainfo->largest_file_shuffle) 452 452 ainfo->largest_file_shuffle = size; 453 return true;453 return TRUE; 454 454 } 455 455 456 456 /* Add a memory entry to a shuffle list. */ 457 457 458 static boolean add_memory_shuffle PARAMS ((struct accumulate *, 459 struct shuffle **head, 460 struct shuffle **tail, 461 bfd_byte *data, unsigned long size)); 462 463 static boolean 458 static bfd_boolean add_memory_shuffle 459 PARAMS ((struct accumulate *, struct shuffle **head, struct shuffle **tail, 460 bfd_byte *data, unsigned long size)); 461 462 static bfd_boolean 464 463 add_memory_shuffle (ainfo, head, tail, data, size) 465 464 struct accumulate *ainfo; … … 476 475 { 477 476 bfd_set_error (bfd_error_no_memory); 478 return false;477 return FALSE; 479 478 } 480 479 n->next = NULL; 481 480 n->size = size; 482 n->filep = false;481 n->filep = FALSE; 483 482 n->u.memory = (PTR) data; 484 483 if (*head == (struct shuffle *) NULL) … … 487 486 (*tail)->next = n; 488 487 *tail = n; 489 return true;488 return TRUE; 490 489 } 491 490 … … 501 500 { 502 501 struct accumulate *ainfo; 503 504 ainfo = (struct accumulate *) bfd_malloc (sizeof (struct accumulate)); 502 bfd_size_type amt = sizeof (struct accumulate); 503 504 ainfo = (struct accumulate *) bfd_malloc (amt); 505 505 if (!ainfo) 506 506 return NULL; … … 579 579 bfd_ecoff_debug_init. */ 580 580 581 b oolean581 bfd_boolean 582 582 bfd_ecoff_debug_accumulate (handle, output_bfd, output_debug, output_swap, 583 583 input_bfd, input_debug, input_swap, … … 625 625 long oldrfdbase = 0; 626 626 bfd_byte *fdr_out; 627 bfd_size_type amt; 627 628 628 629 /* Use section_adjust to hold the value to add to a symbol in a … … 665 666 fdr_end = fdr_start + input_symhdr->ifdMax * fdr_add; 666 667 667 input_debug->ifdmap = (RFDT *) bfd_alloc (input_bfd,668 (input_symhdr->ifdMax 669 * sizeof (RFDT)));668 amt = input_symhdr->ifdMax; 669 amt *= sizeof (RFDT); 670 input_debug->ifdmap = (RFDT *) bfd_alloc (input_bfd, amt); 670 671 671 672 sz = (input_symhdr->crfd + input_symhdr->ifdMax) * external_rfd_size; … … 674 675 { 675 676 bfd_set_error (bfd_error_no_memory); 676 return false;677 return FALSE; 677 678 } 678 679 if (!add_memory_shuffle (ainfo, &ainfo->rfd, &ainfo->rfd_end, rfd_out, sz)) 679 return false;680 return FALSE; 680 681 681 682 copied = 0; … … 716 717 name = input_debug->ss + fdr.issBase + fdr.rss; 717 718 718 lookup = (char *) bfd_malloc ( strlen (name) + 20);719 lookup = (char *) bfd_malloc ((bfd_size_type) strlen (name) + 20); 719 720 if (lookup == NULL) 720 return false;721 return FALSE; 721 722 sprintf (lookup, "%s %lx %lx", name, fdr.csym, fdr.caux); 722 723 723 fh = string_hash_lookup (&ainfo->fdr_hash, lookup, true, true);724 fh = string_hash_lookup (&ainfo->fdr_hash, lookup, TRUE, TRUE); 724 725 free (lookup); 725 726 if (fh == (struct string_hash_entry *) NULL) 726 return false;727 return FALSE; 727 728 728 729 if (fh->val != -1) … … 775 776 { 776 777 bfd_set_error (bfd_error_no_memory); 777 return false;778 return FALSE; 778 779 } 779 780 if (!add_memory_shuffle (ainfo, &ainfo->fdr, &ainfo->fdr_end, fdr_out, sz)) 780 return false;781 return FALSE; 781 782 for (fdr_ptr = fdr_start, i = 0; 782 783 fdr_ptr < fdr_end; … … 788 789 bfd_byte *lraw_src; 789 790 bfd_byte *lraw_end; 790 b oolean fgotfilename;791 bfd_boolean fgotfilename; 791 792 792 793 if (input_debug->ifdmap[i] < output_symhdr->ifdMax) … … 824 825 /* Swap in the local symbols, adjust their values, and swap them 825 826 out again. */ 826 fgotfilename = false;827 fgotfilename = FALSE; 827 828 sz = fdr.csym * external_sym_size; 828 829 sym_out = (bfd_byte *) objalloc_alloc (ainfo->memory, sz); … … 830 831 { 831 832 bfd_set_error (bfd_error_no_memory); 832 return false;833 return FALSE; 833 834 } 834 835 if (!add_memory_shuffle (ainfo, &ainfo->sym, &ainfo->sym_end, sym_out, 835 836 sz)) 836 return false;837 return FALSE; 837 838 lraw_src = ((bfd_byte *) input_debug->external_sym 838 839 + fdr.isymBase * input_swap->external_sym_size); … … 886 887 if (! info->relocateable) 887 888 { 888 b oolean ffilename;889 bfd_boolean ffilename; 889 890 const char *name; 890 891 891 892 if (! fgotfilename && internal_sym.iss == fdr.rss) 892 ffilename = true;893 ffilename = TRUE; 893 894 else 894 ffilename = false;895 ffilename = FALSE; 895 896 896 897 /* Hash the name into the string table. */ … … 902 903 struct string_hash_entry *sh; 903 904 904 sh = string_hash_lookup (&ainfo->str_hash, name, true, true);905 sh = string_hash_lookup (&ainfo->str_hash, name, TRUE, TRUE); 905 906 if (sh == (struct string_hash_entry *) NULL) 906 return false;907 return FALSE; 907 908 if (sh->val == -1) 908 909 { … … 922 923 { 923 924 fdr.rss = internal_sym.iss; 924 fgotfilename = true;925 fgotfilename = TRUE; 925 926 } 926 927 } … … 941 942 if (fdr.cbLine > 0) 942 943 { 944 file_ptr pos = input_symhdr->cbLineOffset + fdr.cbLineOffset; 943 945 if (!add_file_shuffle (ainfo, &ainfo->line, &ainfo->line_end, 944 input_bfd, 945 input_symhdr->cbLineOffset + fdr.cbLineOffset, 946 fdr.cbLine)) 947 return false; 946 input_bfd, pos, (unsigned long) fdr.cbLine)) 947 return FALSE; 948 948 fdr.ilineBase = output_symhdr->ilineMax; 949 949 fdr.cbLineOffset = output_symhdr->cbLine; … … 953 953 if (fdr.caux > 0) 954 954 { 955 file_ptr pos = (input_symhdr->cbAuxOffset 956 + fdr.iauxBase * sizeof (union aux_ext)); 955 957 if (!add_file_shuffle (ainfo, &ainfo->aux, &ainfo->aux_end, 956 input_bfd, 957 (input_symhdr->cbAuxOffset 958 + fdr.iauxBase * sizeof (union aux_ext)), 958 input_bfd, pos, 959 959 fdr.caux * sizeof (union aux_ext))) 960 return false;960 return FALSE; 961 961 fdr.iauxBase = output_symhdr->iauxMax; 962 962 output_symhdr->iauxMax += fdr.caux; … … 974 974 else if (fdr.cbSs > 0) 975 975 { 976 file_ptr pos = input_symhdr->cbSsOffset + fdr.issBase; 976 977 if (!add_file_shuffle (ainfo, &ainfo->ss, &ainfo->ss_end, 977 input_bfd, 978 input_symhdr->cbSsOffset + fdr.issBase, 979 fdr.cbSs)) 980 return false; 978 input_bfd, pos, (unsigned long) fdr.cbSs)) 979 return FALSE; 981 980 fdr.issBase = output_symhdr->issMax; 982 981 output_symhdr->issMax += fdr.cbSs; … … 993 992 if (fdr.cpd > 0) 994 993 { 994 file_ptr pos = (input_symhdr->cbPdOffset 995 + fdr.ipdFirst * external_pdr_size); 996 unsigned long size = fdr.cpd * external_pdr_size; 995 997 if (!add_file_shuffle (ainfo, &ainfo->pdr, &ainfo->pdr_end, 996 input_bfd, 997 (input_symhdr->cbPdOffset 998 + fdr.ipdFirst * external_pdr_size), 999 fdr.cpd * external_pdr_size)) 1000 return false; 998 input_bfd, pos, size)) 999 return FALSE; 1001 1000 } 1002 1001 BFD_ASSERT (external_opt_size == input_swap->external_opt_size); 1003 1002 if (fdr.copt > 0) 1004 1003 { 1004 file_ptr pos = (input_symhdr->cbOptOffset 1005 + fdr.ioptBase * external_opt_size); 1006 unsigned long size = fdr.copt * external_opt_size; 1005 1007 if (!add_file_shuffle (ainfo, &ainfo->opt, &ainfo->opt_end, 1006 input_bfd, 1007 (input_symhdr->cbOptOffset 1008 + fdr.ioptBase * external_opt_size), 1009 fdr.copt * external_opt_size)) 1010 return false; 1008 input_bfd, pos, size)) 1009 return FALSE; 1011 1010 } 1012 1011 } … … 1031 1030 { 1032 1031 bfd_set_error (bfd_error_no_memory); 1033 return false;1032 return FALSE; 1034 1033 } 1035 1034 if (!add_memory_shuffle (ainfo, &ainfo->pdr, &ainfo->pdr_end, out, 1036 1035 sz)) 1037 return false;1036 return FALSE; 1038 1037 for (; in < end; in += insz, out += outsz) 1039 1038 { … … 1072 1071 { 1073 1072 bfd_set_error (bfd_error_no_memory); 1074 return false;1073 return FALSE; 1075 1074 } 1076 1075 if (!add_memory_shuffle (ainfo, &ainfo->opt, &ainfo->opt_end, out, 1077 1076 sz)) 1078 return false;1077 return FALSE; 1079 1078 for (; in < end; in += insz, out += outsz) 1080 1079 { … … 1108 1107 } 1109 1108 1110 return true;1109 return TRUE; 1111 1110 } 1112 1111 … … 1114 1113 Return the offset from the fdr string base. */ 1115 1114 1116 static long ecoff_add_string PARAMS ((struct accumulate *, 1117 struct bfd_link_info *, 1118 struct ecoff_debug_info *, 1119 FDR *fdr, const char *string)); 1115 static long ecoff_add_string 1116 PARAMS ((struct accumulate *, struct bfd_link_info *, 1117 struct ecoff_debug_info *, FDR *fdr, const char *string)); 1120 1118 1121 1119 static long … … 1146 1144 struct string_hash_entry *sh; 1147 1145 1148 sh = string_hash_lookup (&ainfo->str_hash, string, true, true);1146 sh = string_hash_lookup (&ainfo->str_hash, string, TRUE, TRUE); 1149 1147 if (sh == (struct string_hash_entry *) NULL) 1150 1148 return -1; … … 1168 1166 /* Add debugging information from a non-ECOFF file. */ 1169 1167 1170 b oolean1168 bfd_boolean 1171 1169 bfd_ecoff_debug_accumulate_other (handle, output_bfd, output_debug, 1172 1170 output_swap, input_bfd, info) … … 1205 1203 fdr.cbSs = 0; 1206 1204 fdr.rss = ecoff_add_string (ainfo, info, output_debug, &fdr, 1207 bfd_ get_filename (input_bfd));1205 bfd_archive_filename (input_bfd)); 1208 1206 if (fdr.rss == -1) 1209 return false;1207 return FALSE; 1210 1208 fdr.isymBase = output_symhdr->isymMax; 1211 1209 … … 1213 1211 symsize = bfd_get_symtab_upper_bound (input_bfd); 1214 1212 if (symsize < 0) 1215 return false;1216 symbols = (asymbol **) bfd_alloc (output_bfd, symsize);1213 return FALSE; 1214 symbols = (asymbol **) bfd_alloc (output_bfd, (bfd_size_type) symsize); 1217 1215 if (symbols == (asymbol **) NULL) 1218 return false;1216 return FALSE; 1219 1217 symcount = bfd_canonicalize_symtab (input_bfd, symbols); 1220 1218 if (symcount < 0) 1221 return false;1219 return FALSE; 1222 1220 sym_end = symbols + symcount; 1223 1221 … … 1237 1235 1238 1236 if (internal_sym.iss == -1) 1239 return false;1237 return FALSE; 1240 1238 if (bfd_is_com_section ((*sym_ptr)->section) 1241 1239 || bfd_is_und_section ((*sym_ptr)->section)) … … 1254 1252 { 1255 1253 bfd_set_error (bfd_error_no_memory); 1256 return false;1254 return FALSE; 1257 1255 } 1258 1256 (*swap_sym_out) (output_bfd, &internal_sym, external_sym); 1259 1257 add_memory_shuffle (ainfo, &ainfo->sym, &ainfo->sym_end, 1260 external_sym, output_swap->external_sym_size); 1258 external_sym, 1259 (unsigned long) output_swap->external_sym_size); 1261 1260 ++fdr.csym; 1262 1261 ++output_symhdr->isymMax; … … 1274 1273 { 1275 1274 bfd_set_error (bfd_error_no_memory); 1276 return false;1275 return FALSE; 1277 1276 } 1278 1277 (*output_swap->swap_fdr_out) (output_bfd, &fdr, external_fdr); 1279 1278 add_memory_shuffle (ainfo, &ainfo->fdr, &ainfo->fdr_end, 1280 external_fdr, output_swap->external_fdr_size); 1279 external_fdr, 1280 (unsigned long) output_swap->external_fdr_size); 1281 1281 1282 1282 ++output_symhdr->ifdMax; 1283 1283 1284 return true;1284 return TRUE; 1285 1285 } 1286 1286 … … 1290 1290 this interface, so that must be changed to do something else. */ 1291 1291 1292 b oolean1292 bfd_boolean 1293 1293 bfd_ecoff_debug_externals (abfd, debug, swap, relocateable, get_extr, 1294 1294 set_index) … … 1296 1296 struct ecoff_debug_info *debug; 1297 1297 const struct ecoff_debug_swap *swap; 1298 b oolean relocateable;1299 b oolean (*get_extr) PARAMS ((asymbol *, EXTR *));1298 bfd_boolean relocateable; 1299 bfd_boolean (*get_extr) PARAMS ((asymbol *, EXTR *)); 1300 1300 void (*set_index) PARAMS ((asymbol *, bfd_size_type)); 1301 1301 { … … 1306 1306 sym_ptr_ptr = bfd_get_outsymbols (abfd); 1307 1307 if (sym_ptr_ptr == NULL) 1308 return true;1308 return TRUE; 1309 1309 1310 1310 for (c = bfd_get_symcount (abfd); c > 0; c--, sym_ptr_ptr++) … … 1316 1316 1317 1317 /* Get the external symbol information. */ 1318 if ( (*get_extr) (sym_ptr, &esym) == false)1318 if (! (*get_extr) (sym_ptr, &esym)) 1319 1319 continue; 1320 1320 1321 1321 /* If we're producing an executable, move common symbols into 1322 1322 bss. */ 1323 if ( relocateable == false)1323 if (! relocateable) 1324 1324 { 1325 1325 if (esym.asym.sc == scCommon) … … 1351 1351 if (! bfd_ecoff_debug_one_external (abfd, debug, swap, 1352 1352 sym_ptr->name, &esym)) 1353 return false;1354 } 1355 1356 return true;1353 return FALSE; 1354 } 1355 1356 return TRUE; 1357 1357 } 1358 1358 1359 1359 /* Add a single external symbol to the debugging information. */ 1360 1360 1361 b oolean1361 bfd_boolean 1362 1362 bfd_ecoff_debug_one_external (abfd, debug, swap, name, esym) 1363 1363 bfd *abfd; … … 1378 1378 < symhdr->issExtMax + namelen + 1) 1379 1379 { 1380 if (ecoff_add_bytes ((char **) &debug->ssext, 1381 (char **) &debug->ssext_end, 1382 symhdr->issExtMax + namelen + 1) 1383 == false) 1384 return false; 1380 if (! ecoff_add_bytes ((char **) &debug->ssext, 1381 (char **) &debug->ssext_end, 1382 symhdr->issExtMax + namelen + 1)) 1383 return FALSE; 1385 1384 } 1386 1385 if ((size_t) ((char *) debug->external_ext_end … … 1388 1387 < (symhdr->iextMax + 1) * external_ext_size) 1389 1388 { 1390 if (ecoff_add_bytes ((char **) &debug->external_ext, 1391 (char **) &debug->external_ext_end, 1392 (symhdr->iextMax + 1) * external_ext_size) 1393 == false) 1394 return false; 1389 if (! ecoff_add_bytes ((char **) &debug->external_ext, 1390 (char **) &debug->external_ext_end, 1391 (symhdr->iextMax + 1) * (size_t) external_ext_size)) 1392 return FALSE; 1395 1393 } 1396 1394 … … 1406 1404 symhdr->issExtMax += namelen + 1; 1407 1405 1408 return true;1406 return TRUE; 1409 1407 } 1410 1408 … … 1507 1505 correctly. */ 1508 1506 1509 static b oolean1507 static bfd_boolean 1510 1508 ecoff_write_symhdr (abfd, debug, swap, where) 1511 1509 bfd *abfd; … … 1521 1519 /* Go to the right location in the file. */ 1522 1520 if (bfd_seek (abfd, where, SEEK_SET) != 0) 1523 return false;1521 return FALSE; 1524 1522 1525 1523 where += swap->external_hdr_size; … … 1550 1548 #undef SET 1551 1549 1552 buff = (PTR) bfd_malloc ( (size_t)swap->external_hdr_size);1550 buff = (PTR) bfd_malloc (swap->external_hdr_size); 1553 1551 if (buff == NULL && swap->external_hdr_size != 0) 1554 1552 goto error_return; 1555 1553 1556 1554 (*swap->swap_hdr_out) (abfd, symhdr, buff); 1557 if (bfd_ write (buff, 1, swap->external_hdr_size, abfd)1555 if (bfd_bwrite (buff, swap->external_hdr_size, abfd) 1558 1556 != swap->external_hdr_size) 1559 1557 goto error_return; … … 1561 1559 if (buff != NULL) 1562 1560 free (buff); 1563 return true;1561 return TRUE; 1564 1562 error_return: 1565 1563 if (buff != NULL) 1566 1564 free (buff); 1567 return false;1565 return FALSE; 1568 1566 } 1569 1567 … … 1574 1572 symbolic header. */ 1575 1573 1576 b oolean1574 bfd_boolean 1577 1575 bfd_ecoff_write_debug (abfd, debug, swap, where) 1578 1576 bfd *abfd; … … 1584 1582 1585 1583 if (! ecoff_write_symhdr (abfd, debug, swap, where)) 1586 return false;1584 return FALSE; 1587 1585 1588 1586 #define WRITE(ptr, count, size, offset) \ 1589 1587 BFD_ASSERT (symhdr->offset == 0 \ 1590 1588 || (bfd_vma) bfd_tell (abfd) == symhdr->offset); \ 1591 if (bfd_ write ((PTR) debug->ptr, size, symhdr->count, abfd)\1589 if (bfd_bwrite ((PTR) debug->ptr, (bfd_size_type) size * symhdr->count, abfd)\ 1592 1590 != size * symhdr->count) \ 1593 return false;1591 return FALSE; 1594 1592 1595 1593 WRITE (line, cbLine, sizeof (unsigned char), cbLineOffset); … … 1598 1596 WRITE (external_sym, isymMax, swap->external_sym_size, cbSymOffset); 1599 1597 WRITE (external_opt, ioptMax, swap->external_opt_size, cbOptOffset); 1600 WRITE (external_aux, iauxMax, sizeof (union aux_ext), cbAuxOffset); 1598 WRITE (external_aux, iauxMax, (bfd_size_type) sizeof (union aux_ext), 1599 cbAuxOffset); 1601 1600 WRITE (ss, issMax, sizeof (char), cbSsOffset); 1602 1601 WRITE (ssext, issExtMax, sizeof (char), cbSsExtOffset); … … 1606 1605 #undef WRITE 1607 1606 1608 return true;1607 return TRUE; 1609 1608 } 1610 1609 1611 1610 /* Write out a shuffle list. */ 1612 1611 1613 static b oolean ecoff_write_shuffle PARAMS ((bfd *,1614 const struct ecoff_debug_swap*,1615 struct shuffle *,PTR space));1616 1617 static b oolean1612 static bfd_boolean ecoff_write_shuffle 1613 PARAMS ((bfd *, const struct ecoff_debug_swap *, struct shuffle *, 1614 PTR space)); 1615 1616 static bfd_boolean 1618 1617 ecoff_write_shuffle (abfd, swap, shuffle, space) 1619 1618 bfd *abfd; … … 1630 1629 if (! l->filep) 1631 1630 { 1632 if (bfd_write (l->u.memory, 1, l->size, abfd) != l->size) 1633 return false; 1631 if (bfd_bwrite (l->u.memory, (bfd_size_type) l->size, abfd) 1632 != l->size) 1633 return FALSE; 1634 1634 } 1635 1635 else 1636 1636 { 1637 1637 if (bfd_seek (l->u.file.input_bfd, l->u.file.offset, SEEK_SET) != 0 1638 || bfd_read (space, 1, l->size, l->u.file.input_bfd) != l->size 1639 || bfd_write (space, 1, l->size, abfd) != l->size) 1640 return false; 1638 || bfd_bread (space, (bfd_size_type) l->size, 1639 l->u.file.input_bfd) != l->size 1640 || bfd_bwrite (space, (bfd_size_type) l->size, abfd) != l->size) 1641 return FALSE; 1641 1642 } 1642 1643 total += l->size; … … 1649 1650 1650 1651 i = swap->debug_align - (total & (swap->debug_align - 1)); 1651 s = (bfd_byte *) bfd_ malloc (i);1652 s = (bfd_byte *) bfd_zmalloc ((bfd_size_type) i); 1652 1653 if (s == NULL && i != 0) 1653 return false; 1654 1655 memset ((PTR) s, 0, i); 1656 if (bfd_write ((PTR) s, 1, i, abfd) != i) 1654 return FALSE; 1655 1656 if (bfd_bwrite ((PTR) s, (bfd_size_type) i, abfd) != i) 1657 1657 { 1658 1658 free (s); 1659 return false;1659 return FALSE; 1660 1660 } 1661 1661 free (s); 1662 1662 } 1663 1663 1664 return true;1664 return TRUE; 1665 1665 } 1666 1666 … … 1668 1668 information. */ 1669 1669 1670 b oolean1670 bfd_boolean 1671 1671 bfd_ecoff_write_accumulated_debug (handle, abfd, debug, swap, info, where) 1672 1672 PTR handle; … … 1679 1679 struct accumulate *ainfo = (struct accumulate *) handle; 1680 1680 PTR space = NULL; 1681 bfd_size_type amt; 1681 1682 1682 1683 if (! ecoff_write_symhdr (abfd, debug, swap, where)) 1683 1684 goto error_return; 1684 1685 1685 space = (PTR) bfd_malloc (ainfo->largest_file_shuffle); 1686 amt = ainfo->largest_file_shuffle; 1687 space = (PTR) bfd_malloc (amt); 1686 1688 if (space == NULL && ainfo->largest_file_shuffle != 0) 1687 1689 goto error_return; … … 1710 1712 BFD_ASSERT (ainfo->ss == (struct shuffle *) NULL); 1711 1713 null = 0; 1712 if (bfd_ write ((PTR) &null, 1,1, abfd) != 1)1714 if (bfd_bwrite ((PTR) &null, (bfd_size_type) 1, abfd) != 1) 1713 1715 goto error_return; 1714 1716 total = 1; … … 1721 1723 1722 1724 len = strlen (sh->root.string); 1723 if (bfd_write ((PTR) sh->root.string, 1, len + 1, abfd) != len + 1) 1725 amt = len + 1; 1726 if (bfd_bwrite ((PTR) sh->root.string, amt, abfd) != amt) 1724 1727 goto error_return; 1725 1728 total += len + 1; … … 1732 1735 1733 1736 i = swap->debug_align - (total & (swap->debug_align - 1)); 1734 s = (bfd_byte *) bfd_ malloc (i);1737 s = (bfd_byte *) bfd_zmalloc ((bfd_size_type) i); 1735 1738 if (s == NULL && i != 0) 1736 1739 goto error_return; 1737 memset ((PTR) s, 0, i); 1738 if (bfd_ write ((PTR) s, 1,i, abfd) != i)1740 1741 if (bfd_bwrite ((PTR) s, (bfd_size_type) i, abfd) != i) 1739 1742 { 1740 1743 free (s); … … 1747 1750 /* The external strings and symbol are not converted over to using 1748 1751 shuffles. FIXME: They probably should be. */ 1749 if (bfd_write (debug->ssext, 1, debug->symbolic_header.issExtMax, abfd)1750 != (bfd_size_type) debug->symbolic_header.issExtMax)1752 amt = debug->symbolic_header.issExtMax; 1753 if (bfd_bwrite (debug->ssext, amt, abfd) != amt) 1751 1754 goto error_return; 1752 1755 if ((debug->symbolic_header.issExtMax & (swap->debug_align - 1)) != 0) … … 1757 1760 i = (swap->debug_align 1758 1761 - (debug->symbolic_header.issExtMax & (swap->debug_align - 1))); 1759 s = (bfd_byte *) bfd_ malloc (i);1762 s = (bfd_byte *) bfd_zmalloc ((bfd_size_type) i); 1760 1763 if (s == NULL && i != 0) 1761 1764 goto error_return; 1762 memset ((PTR) s, 0, i); 1763 if (bfd_ write ((PTR) s, 1,i, abfd) != i)1765 1766 if (bfd_bwrite ((PTR) s, (bfd_size_type) i, abfd) != i) 1764 1767 { 1765 1768 free (s); … … 1777 1780 == (bfd_vma) bfd_tell (abfd))); 1778 1781 1779 if (bfd_write (debug->external_ext, swap->external_ext_size, 1780 debug->symbolic_header.iextMax, abfd) 1781 != debug->symbolic_header.iextMax * swap->external_ext_size) 1782 amt = debug->symbolic_header.iextMax * swap->external_ext_size; 1783 if (bfd_bwrite (debug->external_ext, amt, abfd) != amt) 1782 1784 goto error_return; 1783 1785 1784 1786 if (space != NULL) 1785 1787 free (space); 1786 return true;1788 return TRUE; 1787 1789 1788 1790 error_return: 1789 1791 if (space != NULL) 1790 1792 free (space); 1791 return false;1793 return FALSE; 1792 1794 } 1793 1795 … … 1821 1823 search. */ 1822 1824 1823 static b oolean1825 static bfd_boolean 1824 1826 mk_fdrtab (abfd, debug_info, debug_swap, line_info) 1825 1827 bfd *abfd; … … 1832 1834 FDR *fdr_start; 1833 1835 FDR *fdr_end; 1834 b oolean stabs;1836 bfd_boolean stabs; 1835 1837 long len; 1838 bfd_size_type amt; 1836 1839 1837 1840 fdr_start = debug_info->fdr; 1838 1841 fdr_end = fdr_start + debug_info->symbolic_header.ifdMax; 1839 1842 1840 /* First, let's see how long the table needs to be :*/1843 /* First, let's see how long the table needs to be. */ 1841 1844 for (len = 0, fdr_ptr = fdr_start; fdr_ptr < fdr_end; fdr_ptr++) 1842 1845 { 1843 if (fdr_ptr->cpd == 0) /* skip FDRs that have no PDRs*/1846 if (fdr_ptr->cpd == 0) /* Skip FDRs that have no PDRs. */ 1844 1847 continue; 1845 1848 ++len; 1846 1849 } 1847 1850 1848 /* Now, create and fill in the table: */ 1849 1850 line_info->fdrtab = ((struct ecoff_fdrtab_entry*) 1851 bfd_zalloc (abfd, 1852 len * sizeof (struct ecoff_fdrtab_entry))); 1851 /* Now, create and fill in the table. */ 1852 amt = (bfd_size_type) len * sizeof (struct ecoff_fdrtab_entry); 1853 line_info->fdrtab = (struct ecoff_fdrtab_entry*) bfd_zalloc (abfd, amt); 1853 1854 if (line_info->fdrtab == NULL) 1854 return false;1855 return FALSE; 1855 1856 line_info->fdrtab_len = len; 1856 1857 … … 1864 1865 a file with stabs debugging information, the second local 1865 1866 symbol is named @stabs. */ 1866 stabs = false;1867 stabs = FALSE; 1867 1868 if (fdr_ptr->csym >= 2) 1868 1869 { … … 1871 1872 1872 1873 sym_ptr = ((char *) debug_info->external_sym 1873 + (fdr_ptr->isymBase + 1) *debug_swap->external_sym_size);1874 + (fdr_ptr->isymBase + 1) * debug_swap->external_sym_size); 1874 1875 (*debug_swap->swap_sym_in) (abfd, sym_ptr, &sym); 1875 1876 if (strcmp (debug_info->ss + fdr_ptr->issBase + sym.iss, 1876 1877 STABS_SYMBOL) == 0) 1877 stabs = true;1878 stabs = TRUE; 1878 1879 } 1879 1880 1880 1881 if (!stabs) 1881 1882 { 1882 bfd_size_type external_pdr_size; 1883 char *pdr_ptr; 1884 PDR pdr; 1885 1886 external_pdr_size = debug_swap->external_pdr_size; 1887 1888 pdr_ptr = ((char *) debug_info->external_pdr 1889 + fdr_ptr->ipdFirst * external_pdr_size); 1890 (*debug_swap->swap_pdr_in) (abfd, (PTR) pdr_ptr, &pdr); 1883 /* eraxxon: There are at least two problems with this computation: 1884 1) PDRs do *not* contain offsets but full vma's; and typically the 1885 address of the first PDR is the address of the FDR, which will 1886 make (most) of the results of the original computation 0! 1887 2) Once in a wacky while, the Compaq compiler generated PDR 1888 addresses do not equal the FDR vma, but they (the PDR address) 1889 are still vma's and not offsets. Cf. comments in 1890 'lookup_line'. */ 1891 #if 0 1892 bfd_size_type external_pdr_size; 1893 char *pdr_ptr; 1894 PDR pdr; 1895 1896 external_pdr_size = debug_swap->external_pdr_size; 1897 1898 pdr_ptr = ((char *) debug_info->external_pdr 1899 + fdr_ptr->ipdFirst * external_pdr_size); 1900 (*debug_swap->swap_pdr_in) (abfd, (PTR) pdr_ptr, &pdr); 1891 1901 /* The address of the first PDR is the offset of that 1892 1902 procedure relative to the beginning of file FDR. */ 1893 tab->base_addr = fdr_ptr->adr - pdr.adr; 1903 tab->base_addr = fdr_ptr->adr - pdr.adr; 1904 #else 1905 /* The address of the first PDR is the offset of that 1906 procedure relative to the beginning of file FDR. */ 1907 tab->base_addr = fdr_ptr->adr; 1908 #endif 1894 1909 } 1895 1910 else 1896 1911 { 1897 1912 /* XXX I don't know about stabs, so this is a guess 1898 (davidm@cs.arizona.edu) :*/1913 (davidm@cs.arizona.edu). */ 1899 1914 tab->base_addr = fdr_ptr->adr; 1900 1915 } … … 1907 1922 static functions in include files), where this does not hold. 1908 1923 Use "odump -PFv" to verify... */ 1909 qsort ((PTR) line_info->fdrtab, len,1924 qsort ((PTR) line_info->fdrtab, (size_t) len, 1910 1925 sizeof (struct ecoff_fdrtab_entry), cmp_fdrtab_entry); 1911 1926 1912 return true;1927 return TRUE; 1913 1928 } 1914 1929 … … 1940 1955 low = mid + 1; 1941 1956 } 1957 1958 /* eraxxon: at this point 'offset' is either lower than the lowest entry or 1959 higher than the highest entry. In the former case high = low = mid = 0; 1960 we want to return -1. In the latter case, low = high and mid = low - 1; 1961 we want to return the index of the highest entry. Only in former case 1962 will the following 'catch-all' test be true. */ 1942 1963 ++mid; 1943 1964 1944 /* last entry is catch-all for all higher addresses:*/1965 /* Last entry is catch-all for all higher addresses. */ 1945 1966 if (offset < tab[mid].base_addr) 1946 1967 return -1; … … 1948 1969 find_min: 1949 1970 1971 /* eraxxon: There may be multiple FDRs in the table with the 1972 same base_addr; make sure that we are at the first one. */ 1950 1973 while (mid > 0 && tab[mid - 1].base_addr == tab[mid].base_addr) 1951 1974 --mid; … … 1957 1980 LINE_INFO->cache. */ 1958 1981 1959 static b oolean1982 static bfd_boolean 1960 1983 lookup_line (abfd, debug_info, debug_swap, line_info) 1961 1984 bfd *abfd; … … 1966 1989 struct ecoff_fdrtab_entry *tab; 1967 1990 bfd_vma offset; 1968 b oolean stabs;1991 bfd_boolean stabs; 1969 1992 FDR *fdr_ptr; 1970 1993 int i; 1971 1994 1995 /* eraxxon: note that 'offset' is the full vma, not a section offset. */ 1972 1996 offset = line_info->cache.start; 1973 1997 … … 1976 2000 if (line_info->fdrtab == NULL 1977 2001 && !mk_fdrtab (abfd, debug_info, debug_swap, line_info)) 1978 return false;2002 return FALSE; 1979 2003 1980 2004 tab = line_info->fdrtab; 1981 2005 1982 /* find first FDR for address OFFSET*/2006 /* Find first FDR for address OFFSET. */ 1983 2007 i = fdrtab_lookup (line_info, offset); 1984 2008 if (i < 0) 1985 return false; /* no FDR, no fun... */ 2009 return FALSE; /* no FDR, no fun... */ 2010 2011 /* eraxxon: 'fdrtab_lookup' doesn't give what we want, at least for Compaq's 2012 C++ compiler 6.2. Consider three FDRs with starting addresses of x, y, 2013 and z, respectively, such that x < y < z. Assume further that 2014 y < 'offset' < z. It is possble at times that the PDR for 'offset' is 2015 associated with FDR x and *not* with FDR y. Erg!! 2016 2017 From a binary dump of my C++ test case 'moo' using Compaq's coffobjanl 2018 (output format has been edited for our purposes): 2019 2020 FDR [2]: (main.C): First instruction: 0x12000207c <x> 2021 PDR [5] for File [2]: LoopTest__Xv <0x1200020a0> (a) 2022 PDR [7] for File [2]: foo__Xv <0x120002168> 2023 FDR [1]: (-1): First instruction: 0x1200020e8 <y> 2024 PDR [3] for File [1]: <0x120001ad0> (b) 2025 FDR [6]: (-1): First instruction: 0x1200026f0 <z> 2026 2027 (a) In the case of PDR5, the vma is such that the first few instructions 2028 of the procedure can be found. But since the size of this procedure is 2029 160b, the vma will soon cross into the 'address space' of FDR1 and no 2030 debugging info will be found. How repugnant! 2031 2032 (b) It is also possible for a PDR to have a *lower* vma than its associated 2033 FDR; see FDR1 and PDR3. Gross! 2034 2035 Since the FDRs that are causing so much havok (in this case) 1) do not 2036 describe actual files (fdr.rss == -1), and 2) contain only compiler 2037 genarated routines, I thought a simple fix would be to exclude them from 2038 the FDR table in 'mk_fdrtab'. But, besides not knowing for certain 2039 whether this would be correct, it creates an additional problem. If we 2040 happen to ask for source file info on a compiler generated (procedure) 2041 symbol -- which is still in the symbol table -- the result can be 2042 information from a real procedure! This is because compiler generated 2043 procedures with vma's higher than the last FDR in the fdr table will be 2044 associated with a PDR from this FDR, specifically the PDR with the 2045 highest vma. This wasn't a problem before, because each procedure had a 2046 PDR. (Yes, this problem could be eliminated if we kept the size of the 2047 last PDR around, but things are already getting ugly). 2048 2049 Probably, a better solution would be to have a sorted PDR table. Each 2050 PDR would have a pointer to its FDR so file information could still be 2051 obtained. A FDR table could still be constructed if necessary -- since 2052 it only contains pointers, not much extra memory would be used -- but 2053 the PDR table would be searched to locate debugging info. 2054 2055 There is still at least one remaining issue. Sometimes a FDR can have a 2056 bogus name, but contain PDRs that should belong to another FDR with a 2057 real name. E.g: 2058 2059 FDR [3]: 0000000120001b50 (/home/.../Array.H~alt~deccxx_5E5A62AD) 2060 PDR [a] for File [3]: 0000000120001b50 2061 PDR [b] for File [3]: 0000000120001cf0 2062 PDR [c] for File [3]: 0000000120001dc8 2063 PDR [d] for File [3]: 0000000120001e40 2064 PDR [e] for File [3]: 0000000120001eb8 2065 PDR [f] for File [3]: 0000000120001f4c 2066 FDR [4]: 0000000120001b50 (/home/.../Array.H) 2067 2068 Here, FDR4 has the correct name, but should (seemingly) contain PDRa-f. 2069 The symbol table for PDR4 does contain symbols for PDRa-f, but so does 2070 the symbol table for FDR3. However the former is different; perhaps this 2071 can be detected easily. (I'm not sure at this point.) This problem only 2072 seems to be associated with files with templates. I am assuming the idea 2073 is that there is a 'fake' FDR (with PDRs) for each differently typed set 2074 of templates that must be generated. Currently, FDR4 is completely 2075 excluded from the FDR table in 'mk_fdrtab' because it contains no PDRs. 2076 2077 Since I don't have time to prepare a real fix for this right now, be 2078 prepared for 'A Horrible Hack' to force the inspection of all non-stabs 2079 FDRs. It's coming... */ 1986 2080 fdr_ptr = tab[i].fdr; 1987 2081 … … 1989 2083 file with stabs debugging information, the second local symbol is 1990 2084 named @stabs. */ 1991 stabs = false;2085 stabs = FALSE; 1992 2086 if (fdr_ptr->csym >= 2) 1993 2087 { … … 2000 2094 if (strcmp (debug_info->ss + fdr_ptr->issBase + sym.iss, 2001 2095 STABS_SYMBOL) == 0) 2002 stabs = true;2096 stabs = TRUE; 2003 2097 } 2004 2098 … … 2009 2103 char *best_pdr = NULL; 2010 2104 FDR *best_fdr; 2011 bfd_ vma best_dist = ~0;2105 bfd_signed_vma best_dist = -1; 2012 2106 PDR pdr; 2013 2107 unsigned char *line_ptr; … … 2071 2165 external_pdr_size = debug_swap->external_pdr_size; 2072 2166 2073 /* Make offset relative to object file's start-address: */ 2167 #if 0 /* eraxxon: PDR addresses (pdr.adr) are not relative to FDRs! 2168 Leave 'offset' alone. */ 2169 /* Make offset relative to object file's start-address. */ 2074 2170 offset -= tab[i].base_addr; 2171 #endif 2172 /* eraxxon: The Horrible Hack: Because of the problems above, set 'i' 2173 to 0 so we look through all FDRs. 2174 2175 Because FDR's without any symbols are assumed to be non-stabs, 2176 searching through all FDRs may cause the following code to try to 2177 read stabs FDRs as ECOFF ones. However, I don't think this will 2178 harm anything. */ 2179 i = 0; 2180 2075 2181 /* Search FDR list starting at tab[i] for the PDR that best matches 2076 2182 OFFSET. Normally, the FDR list is only one entry long. */ … … 2078 2184 do 2079 2185 { 2080 bfd_vma dist, min_dist = 0; 2186 /* eraxxon: 'dist' and 'min_dist' can be negative now 2187 because we iterate over every FDR rather than just ones 2188 with a base address less than or equal to 'offset'. */ 2189 bfd_signed_vma dist = -1, min_dist = -1; 2081 2190 char *pdr_hold; 2082 2191 char *pdr_end; … … 2101 2210 { 2102 2211 dist = offset - (pdr.adr - 0x10 * pdr.prof); 2103 if (!pdr_hold || dist < min_dist) 2212 2213 /* eraxxon: 'dist' can be negative now. Note that 2214 'min_dist' can be negative if 'pdr_hold' below is NULL. */ 2215 if (!pdr_hold || (dist >= 0 && dist < min_dist)) 2104 2216 { 2105 2217 min_dist = dist; … … 2109 2221 } 2110 2222 2111 if (!best_pdr || min_dist < best_dist)2223 if (!best_pdr || (min_dist >= 0 && min_dist < best_dist)) 2112 2224 { 2113 best_dist = min_dist;2225 best_dist = (bfd_vma) min_dist; 2114 2226 best_fdr = fdr_ptr; 2115 2227 best_pdr = pdr_hold; 2116 2228 } 2117 /* continue looping until base_addr of next entry is different: */ 2118 } 2119 while (++i < line_info->fdrtab_len 2120 && tab[i].base_addr == tab[i - 1].base_addr); 2229 /* Continue looping until base_addr of next entry is different. */ 2230 } 2231 /* eraxxon: We want to iterate over all FDRs. 2232 See previous comment about 'fdrtab_lookup'. */ 2233 while (++i < line_info->fdrtab_len); 2121 2234 2122 2235 if (!best_fdr || !best_pdr) 2123 return false; /* shouldn't happen... */2124 2125 /* phew, finally we got something that we can hold onto:*/2236 return FALSE; /* Shouldn't happen... */ 2237 2238 /* Phew, finally we got something that we can hold onto. */ 2126 2239 fdr_ptr = best_fdr; 2127 2240 pdr_ptr = best_pdr; … … 2133 2246 line_end = debug_info->line + fdr_ptr->cbLineOffset + fdr_ptr->cbLine; 2134 2247 2135 /* Make offset relative to procedure entry :*/2248 /* Make offset relative to procedure entry. */ 2136 2249 offset -= pdr.adr - 0x10 * pdr.prof; 2137 2250 lineno = pdr.lnLow; … … 2214 2327 bfd_vma low_func_vma; 2215 2328 bfd_vma low_line_vma; 2216 b oolean past_line;2217 b oolean past_fn;2329 bfd_boolean past_line; 2330 bfd_boolean past_fn; 2218 2331 char *sym_ptr, *sym_ptr_end; 2219 2332 size_t len, funclen; … … 2241 2354 low_func_vma = 0; 2242 2355 low_line_vma = 0; 2243 past_line = false;2244 past_fn = false;2356 past_line = FALSE; 2357 past_fn = FALSE; 2245 2358 2246 2359 external_sym_size = debug_swap->external_sym_size; … … 2292 2405 case N_FUN: 2293 2406 if (sym.value > offset) 2294 past_fn = true;2407 past_fn = TRUE; 2295 2408 else if (sym.value >= low_func_vma) 2296 2409 { … … 2305 2418 { 2306 2419 if (sym.value > offset) 2307 past_line = true;2420 past_line = TRUE; 2308 2421 else if (sym.value >= low_line_vma) 2309 2422 { … … 2335 2448 if (line_info->find_buffer != NULL) 2336 2449 free (line_info->find_buffer); 2337 buffer = (char *) bfd_malloc ( len);2450 buffer = (char *) bfd_malloc ((bfd_size_type) len); 2338 2451 if (buffer == NULL) 2339 return false;2452 return FALSE; 2340 2453 line_info->find_buffer = buffer; 2341 2454 } … … 2365 2478 } 2366 2479 2367 return true;2480 return TRUE; 2368 2481 } 2369 2482 2370 2483 /* Do the work of find_nearest_line. */ 2371 2484 2372 b oolean2485 bfd_boolean 2373 2486 _bfd_ecoff_locate_line (abfd, section, offset, debug_info, debug_swap, 2374 2487 line_info, filename_ptr, functionname_ptr, retline_ptr) … … 2396 2509 { 2397 2510 line_info->cache.sect = NULL; 2398 return false;2511 return FALSE; 2399 2512 } 2400 2513 } … … 2404 2517 *retline_ptr = line_info->cache.line_num; 2405 2518 2406 return true;2519 return TRUE; 2407 2520 } 2408 2521 … … 2418 2531 /* Collect a shuffle into a memory buffer. */ 2419 2532 2420 static boolean ecoff_collect_shuffle PARAMS ((struct shuffle *, bfd_byte *)); 2421 2422 static boolean 2533 static bfd_boolean ecoff_collect_shuffle 2534 PARAMS ((struct shuffle *, bfd_byte *)); 2535 2536 static bfd_boolean 2423 2537 ecoff_collect_shuffle (l, buff) 2424 2538 struct shuffle *l; … … 2435 2549 { 2436 2550 if (bfd_seek (l->u.file.input_bfd, l->u.file.offset, SEEK_SET) != 0 2437 || bfd_read (buff, 1, l->size, l->u.file.input_bfd) != l->size) 2438 return false; 2551 || (bfd_bread (buff, (bfd_size_type) l->size, l->u.file.input_bfd) 2552 != l->size)) 2553 return FALSE; 2439 2554 } 2440 2555 total += l->size; … … 2442 2557 } 2443 2558 2444 return true;2559 return TRUE; 2445 2560 } 2446 2561 2447 2562 /* Copy PDR information into a memory buffer. */ 2448 2563 2449 b oolean2564 bfd_boolean 2450 2565 _bfd_ecoff_get_accumulated_pdr (handle, buff) 2451 2566 PTR handle; … … 2459 2574 /* Copy symbol information into a memory buffer. */ 2460 2575 2461 b oolean2576 bfd_boolean 2462 2577 _bfd_ecoff_get_accumulated_sym (handle, buff) 2463 2578 PTR handle; … … 2471 2586 /* Copy the string table into a memory buffer. */ 2472 2587 2473 b oolean2588 bfd_boolean 2474 2589 _bfd_ecoff_get_accumulated_ss (handle, buff) 2475 2590 PTR handle; … … 2498 2613 } 2499 2614 2500 return true;2501 } 2615 return TRUE; 2616 } -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.