Changeset 609 for branches/GNU/src/binutils/bfd/sunos.c
- Timestamp:
- Aug 16, 2003, 6:59:22 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GNU/src/binutils/bfd/sunos.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 1 /* BFD backend for SunOS binaries. 2 Copyright 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 2000 3 Free Software Foundation, Inc.2 Copyright 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 2000, 2001, 3 2002 Free Software Foundation, Inc. 4 4 Written by Cygnus Support. 5 5 … … 21 21 22 22 #define TARGETNAME "a.out-sunos-big" 23 #define MY(OP) CAT(sunos_big_,OP) 23 24 /* Do not "beautify" the CONCAT* macro args. Traditional C will not 25 remove whitespace added here, and thus will fail to concatenate 26 the tokens. */ 27 #define MY(OP) CONCAT2 (sunos_big_,OP) 24 28 25 29 #include "bfd.h" … … 29 33 /* Static routines defined in this file. */ 30 34 31 static b oolean sunos_read_dynamic_info PARAMS ((bfd *));35 static bfd_boolean sunos_read_dynamic_info PARAMS ((bfd *)); 32 36 static long sunos_get_dynamic_symtab_upper_bound PARAMS ((bfd *)); 33 static b oolean sunos_slurp_dynamic_symtab PARAMS ((bfd *));37 static bfd_boolean sunos_slurp_dynamic_symtab PARAMS ((bfd *)); 34 38 static long sunos_canonicalize_dynamic_symtab PARAMS ((bfd *, asymbol **)); 35 39 static long sunos_get_dynamic_reloc_upper_bound PARAMS ((bfd *)); … … 40 44 static struct bfd_link_hash_table *sunos_link_hash_table_create 41 45 PARAMS ((bfd *)); 42 static b oolean sunos_create_dynamic_sections43 PARAMS ((bfd *, struct bfd_link_info *, b oolean));44 static b oolean sunos_add_dynamic_symbols46 static bfd_boolean sunos_create_dynamic_sections 47 PARAMS ((bfd *, struct bfd_link_info *, bfd_boolean)); 48 static bfd_boolean sunos_add_dynamic_symbols 45 49 PARAMS ((bfd *, struct bfd_link_info *, struct external_nlist **, 46 50 bfd_size_type *, char **)); 47 static b oolean sunos_add_one_symbol51 static bfd_boolean sunos_add_one_symbol 48 52 PARAMS ((struct bfd_link_info *, bfd *, const char *, flagword, asection *, 49 bfd_vma, const char *, b oolean,boolean,53 bfd_vma, const char *, bfd_boolean, bfd_boolean, 50 54 struct bfd_link_hash_entry **)); 51 static b oolean sunos_scan_relocs55 static bfd_boolean sunos_scan_relocs 52 56 PARAMS ((struct bfd_link_info *, bfd *, asection *, bfd_size_type)); 53 static b oolean sunos_scan_std_relocs57 static bfd_boolean sunos_scan_std_relocs 54 58 PARAMS ((struct bfd_link_info *, bfd *, asection *, 55 59 const struct reloc_std_external *, bfd_size_type)); 56 static b oolean sunos_scan_ext_relocs60 static bfd_boolean sunos_scan_ext_relocs 57 61 PARAMS ((struct bfd_link_info *, bfd *, asection *, 58 62 const struct reloc_ext_external *, bfd_size_type)); 59 static b oolean sunos_link_dynamic_object63 static bfd_boolean sunos_link_dynamic_object 60 64 PARAMS ((struct bfd_link_info *, bfd *)); 61 static b oolean sunos_write_dynamic_symbol65 static bfd_boolean sunos_write_dynamic_symbol 62 66 PARAMS ((bfd *, struct bfd_link_info *, struct aout_link_hash_entry *)); 63 static b oolean sunos_check_dynamic_reloc67 static bfd_boolean sunos_check_dynamic_reloc 64 68 PARAMS ((struct bfd_link_info *, bfd *, asection *, 65 struct aout_link_hash_entry *, PTR, bfd_byte *, b oolean *,69 struct aout_link_hash_entry *, PTR, bfd_byte *, bfd_boolean *, 66 70 bfd_vma *)); 67 static b oolean sunos_finish_dynamic_link71 static bfd_boolean sunos_finish_dynamic_link 68 72 PARAMS ((bfd *, struct bfd_link_info *)); 69 73 … … 102 106 { 103 107 /* Whether we found any dynamic information. */ 104 b oolean valid;108 bfd_boolean valid; 105 109 /* Dynamic information. */ 106 110 struct internal_sun4_dynamic_link dyninfo; … … 131 135 creates and saves a sunos_dynamic_info structure. If it can't find 132 136 __DYNAMIC, it sets the valid field of the sunos_dynamic_info 133 structure to falseto avoid doing this work again. */134 135 static b oolean137 structure to FALSE to avoid doing this work again. */ 138 139 static bfd_boolean 136 140 sunos_read_dynamic_info (abfd) 137 141 bfd *abfd; … … 143 147 unsigned long dynver; 144 148 struct external_sun4_dynamic_link linkinfo; 149 bfd_size_type amt; 145 150 146 151 if (obj_aout_dynamic_info (abfd) != (PTR) NULL) 147 return true;152 return TRUE; 148 153 149 154 if ((abfd->flags & DYNAMIC) == 0) 150 155 { 151 156 bfd_set_error (bfd_error_invalid_operation); 152 return false;153 } 154 155 info = ((struct sunos_dynamic_info *)156 bfd_zalloc (abfd, sizeof (struct sunos_dynamic_info)));157 return FALSE; 158 } 159 160 amt = sizeof (struct sunos_dynamic_info); 161 info = (struct sunos_dynamic_info *) bfd_zalloc (abfd, amt); 157 162 if (!info) 158 return false;159 info->valid = false;163 return FALSE; 164 info->valid = FALSE; 160 165 info->dynsym = NULL; 161 166 info->dynstr = NULL; … … 173 178 symbols for the __DYNAMIC symbol. */ 174 179 if ((abfd->flags & DYNAMIC) == 0) 175 return true;180 return TRUE; 176 181 if (! bfd_get_section_contents (abfd, obj_datasec (abfd), (PTR) &dyninfo, 177 (file_ptr) 0, sizeof dyninfo)) 178 return true; 182 (file_ptr) 0, 183 (bfd_size_type) sizeof dyninfo)) 184 return TRUE; 179 185 180 186 dynver = GET_WORD (abfd, dyninfo.ld_version); 181 187 if (dynver != 2 && dynver != 3) 182 return true;188 return TRUE; 183 189 184 190 dynoff = GET_WORD (abfd, dyninfo.ld); … … 192 198 dynoff -= bfd_get_section_vma (abfd, dynsec); 193 199 if (dynoff > bfd_section_size (abfd, dynsec)) 194 return true;200 return TRUE; 195 201 196 202 /* This executable appears to be dynamically linked in a way that we 197 203 can understand. */ 198 if (! bfd_get_section_contents (abfd, dynsec, (PTR) &linkinfo, dynoff, 204 if (! bfd_get_section_contents (abfd, dynsec, (PTR) &linkinfo, 205 (file_ptr) dynoff, 199 206 (bfd_size_type) sizeof linkinfo)) 200 return true;207 return TRUE; 201 208 202 209 /* Swap in the dynamic link information. */ … … 245 252 - info->dyninfo.ld_rel)); 246 253 247 info->valid = true;248 249 return true;254 info->valid = TRUE; 255 256 return TRUE; 250 257 } 251 258 … … 273 280 /* Read the external dynamic symbols. */ 274 281 275 static b oolean282 static bfd_boolean 276 283 sunos_slurp_dynamic_symtab (abfd) 277 284 bfd *abfd; 278 285 { 279 286 struct sunos_dynamic_info *info; 287 bfd_size_type amt; 280 288 281 289 /* Get the general dynamic information. */ … … 283 291 { 284 292 if (! sunos_read_dynamic_info (abfd)) 285 return false;293 return FALSE; 286 294 } 287 295 … … 290 298 { 291 299 bfd_set_error (bfd_error_no_symbols); 292 return false;300 return FALSE; 293 301 } 294 302 … … 296 304 if (info->dynsym == (struct external_nlist *) NULL) 297 305 { 298 info->dynsym = ((struct external_nlist *) 299 bfd_alloc (abfd, 300 (info->dynsym_count 301 * EXTERNAL_NLIST_SIZE))); 306 amt = (bfd_size_type) info->dynsym_count * EXTERNAL_NLIST_SIZE; 307 info->dynsym = (struct external_nlist *) bfd_alloc (abfd, amt); 302 308 if (info->dynsym == NULL && info->dynsym_count != 0) 303 return false; 304 if (bfd_seek (abfd, info->dyninfo.ld_stab, SEEK_SET) != 0 305 || (bfd_read ((PTR) info->dynsym, info->dynsym_count, 306 EXTERNAL_NLIST_SIZE, abfd) 307 != info->dynsym_count * EXTERNAL_NLIST_SIZE)) 309 return FALSE; 310 if (bfd_seek (abfd, (file_ptr) info->dyninfo.ld_stab, SEEK_SET) != 0 311 || bfd_bread ((PTR) info->dynsym, amt, abfd) != amt) 308 312 { 309 313 if (info->dynsym != NULL) … … 312 316 info->dynsym = NULL; 313 317 } 314 return false;318 return FALSE; 315 319 } 316 320 } … … 319 323 if (info->dynstr == (char *) NULL) 320 324 { 321 info->dynstr = (char *) bfd_alloc (abfd, info->dyninfo.ld_symb_size); 325 amt = info->dyninfo.ld_symb_size; 326 info->dynstr = (char *) bfd_alloc (abfd, amt); 322 327 if (info->dynstr == NULL && info->dyninfo.ld_symb_size != 0) 323 return false; 324 if (bfd_seek (abfd, info->dyninfo.ld_symbols, SEEK_SET) != 0 325 || (bfd_read ((PTR) info->dynstr, 1, info->dyninfo.ld_symb_size, 326 abfd) 327 != info->dyninfo.ld_symb_size)) 328 return FALSE; 329 if (bfd_seek (abfd, (file_ptr) info->dyninfo.ld_symbols, SEEK_SET) != 0 330 || bfd_bread ((PTR) info->dynstr, amt, abfd) != amt) 328 331 { 329 332 if (info->dynstr != NULL) … … 332 335 info->dynstr = NULL; 333 336 } 334 return false;335 } 336 } 337 338 return true;337 return FALSE; 338 } 339 } 340 341 return TRUE; 339 342 } 340 343 … … 368 371 if (table == NULL && table_size != 0) 369 372 abort (); 370 if (bfd_seek (abfd, info->dyninfo.ld_hash, SEEK_SET) != 0371 || bfd_ read ((PTR) table, 1, table_size, abfd) != table_size)373 if (bfd_seek (abfd, (file_ptr) info->dyninfo.ld_hash, SEEK_SET) != 0 374 || bfd_bread ((PTR) table, table_size, abfd) != table_size) 372 375 abort (); 373 376 for (i = 0; i < info->dynsym_count; i++) … … 399 402 if (info->canonical_dynsym == (aout_symbol_type *) NULL) 400 403 { 401 info->canonical_dynsym = ((aout_symbol_type *) 402 bfd_alloc (abfd, 403 (info->dynsym_count 404 * sizeof (aout_symbol_type)))); 404 bfd_size_type size; 405 bfd_size_type strsize = info->dyninfo.ld_symb_size; 406 407 size = (bfd_size_type) info->dynsym_count * sizeof (aout_symbol_type); 408 info->canonical_dynsym = (aout_symbol_type *) bfd_alloc (abfd, size); 405 409 if (info->canonical_dynsym == NULL && info->dynsym_count != 0) 406 410 return -1; 407 411 408 412 if (! aout_32_translate_symbol_table (abfd, info->canonical_dynsym, 409 info->dynsym, info->dynsym_count, 410 info->dynstr, 411 info->dyninfo.ld_symb_size, 412 true)) 413 info->dynsym, 414 (bfd_size_type) info->dynsym_count, 415 info->dynstr, strsize, TRUE)) 413 416 { 414 417 if (info->canonical_dynsym != NULL) … … 460 463 struct sunos_dynamic_info *info; 461 464 unsigned long i; 465 bfd_size_type size; 462 466 463 467 /* Get the general dynamic information. */ … … 478 482 if (info->dynrel == NULL) 479 483 { 480 info->dynrel = (PTR) bfd_alloc (abfd, 481 (info->dynrel_count 482 * obj_reloc_entry_size (abfd))); 483 if (info->dynrel == NULL && info->dynrel_count != 0) 484 size = (bfd_size_type) info->dynrel_count * obj_reloc_entry_size (abfd); 485 info->dynrel = (PTR) bfd_alloc (abfd, size); 486 if (info->dynrel == NULL && size != 0) 484 487 return -1; 485 if (bfd_seek (abfd, info->dyninfo.ld_rel, SEEK_SET) != 0 486 || (bfd_read ((PTR) info->dynrel, info->dynrel_count, 487 obj_reloc_entry_size (abfd), abfd) 488 != info->dynrel_count * obj_reloc_entry_size (abfd))) 488 if (bfd_seek (abfd, (file_ptr) info->dyninfo.ld_rel, SEEK_SET) != 0 489 || bfd_bread ((PTR) info->dynrel, size, abfd) != size) 489 490 { 490 491 if (info->dynrel != NULL) … … 503 504 arelent *to; 504 505 505 info->canonical_dynrel = ((arelent *) 506 bfd_alloc (abfd, 507 (info->dynrel_count 508 * sizeof (arelent)))); 506 size = (bfd_size_type) info->dynrel_count * sizeof (arelent); 507 info->canonical_dynrel = (arelent *) bfd_alloc (abfd, size); 509 508 if (info->canonical_dynrel == NULL && info->dynrel_count != 0) 510 509 return -1; … … 521 520 for (; p < pend; p++, to++) 522 521 NAME(aout,swap_ext_reloc_in) (abfd, p, to, syms, 523 info->dynsym_count);522 (bfd_size_type) info->dynsym_count); 524 523 } 525 524 else … … 532 531 for (; p < pend; p++, to++) 533 532 NAME(aout,swap_std_reloc_in) (abfd, p, to, syms, 534 info->dynsym_count);533 (bfd_size_type) info->dynsym_count); 535 534 } 536 535 } … … 566 565 567 566 /* save %sp, -96, %sp */ 568 #define SPARC_PLT_ENTRY_WORD0 0x9de3bfa0567 #define SPARC_PLT_ENTRY_WORD0 ((bfd_vma) 0x9de3bfa0) 569 568 /* call; address filled in later. */ 570 #define SPARC_PLT_ENTRY_WORD1 0x40000000569 #define SPARC_PLT_ENTRY_WORD1 ((bfd_vma) 0x40000000) 571 570 /* sethi; reloc index filled in later. */ 572 #define SPARC_PLT_ENTRY_WORD2 0x01000000571 #define SPARC_PLT_ENTRY_WORD2 ((bfd_vma) 0x01000000) 573 572 574 573 /* This sequence is used when for the jump table entry to a defined … … 576 575 compiled code which is not being put into a shared library. */ 577 576 /* sethi <address to be filled in later>, %g1 */ 578 #define SPARC_PLT_PIC_WORD0 0x03000000577 #define SPARC_PLT_PIC_WORD0 ((bfd_vma) 0x03000000) 579 578 /* jmp %g1 + <address to be filled in later> */ 580 #define SPARC_PLT_PIC_WORD1 0x81c06000579 #define SPARC_PLT_PIC_WORD1 ((bfd_vma) 0x81c06000) 581 580 /* nop */ 582 #define SPARC_PLT_PIC_WORD2 0x01000000581 #define SPARC_PLT_PIC_WORD2 ((bfd_vma) 0x01000000) 583 582 584 583 /* An m68k procedure linkage table entry is 8 bytes. The first entry … … 600 599 601 600 /* bsrl */ 602 #define M68K_PLT_ENTRY_WORD0 ( 0x61ff)601 #define M68K_PLT_ENTRY_WORD0 ((bfd_vma) 0x61ff) 603 602 /* Remaining words filled in later. */ 604 603 … … 653 652 654 653 /* Whether we have created the dynamic sections. */ 655 b oolean dynamic_sections_created;654 bfd_boolean dynamic_sections_created; 656 655 657 656 /* Whether we need the dynamic sections. */ 658 b oolean dynamic_sections_needed;657 bfd_boolean dynamic_sections_needed; 659 658 660 659 /* Whether we need the .got table. */ 661 b oolean got_needed;660 bfd_boolean got_needed; 662 661 663 662 /* The number of dynamic symbols. */ … … 717 716 { 718 717 struct sunos_link_hash_table *ret; 719 720 ret = ((struct sunos_link_hash_table *) 721 bfd_alloc (abfd, sizeof (struct sunos_link_hash_table)));718 bfd_size_type amt = sizeof (struct sunos_link_hash_table); 719 720 ret = (struct sunos_link_hash_table *) bfd_malloc (amt); 722 721 if (ret == (struct sunos_link_hash_table *) NULL) 723 722 return (struct bfd_link_hash_table *) NULL; … … 725 724 sunos_link_hash_newfunc)) 726 725 { 727 bfd_release (abfd,ret);726 free (ret); 728 727 return (struct bfd_link_hash_table *) NULL; 729 728 } 730 729 731 730 ret->dynobj = NULL; 732 ret->dynamic_sections_created = false;733 ret->dynamic_sections_needed = false;734 ret->got_needed = false;731 ret->dynamic_sections_created = FALSE; 732 ret->dynamic_sections_needed = FALSE; 733 ret->got_needed = FALSE; 735 734 ret->dynsymcount = 0; 736 735 ret->bucketcount = 0; … … 753 752 (aout_link_hash_traverse \ 754 753 (&(table)->root, \ 755 (b oolean (*) PARAMS ((struct aout_link_hash_entry *, PTR))) (func),\754 (bfd_boolean (*) PARAMS ((struct aout_link_hash_entry *, PTR))) (func), \ 756 755 (info))) 757 756 … … 761 760 #define sunos_hash_table(p) ((struct sunos_link_hash_table *) ((p)->hash)) 762 761 763 static b oolean sunos_scan_dynamic_symbol762 static bfd_boolean sunos_scan_dynamic_symbol 764 763 PARAMS ((struct sunos_link_hash_entry *, PTR)); 765 764 … … 771 770 of the dynamic linking information. */ 772 771 773 static b oolean772 static bfd_boolean 774 773 sunos_create_dynamic_sections (abfd, info, needed) 775 774 bfd *abfd; 776 775 struct bfd_link_info *info; 777 b oolean needed;776 bfd_boolean needed; 778 777 { 779 778 asection *s; … … 795 794 || ! bfd_set_section_flags (abfd, s, flags) 796 795 || ! bfd_set_section_alignment (abfd, s, 2)) 797 return false;796 return FALSE; 798 797 799 798 /* The .got section holds the global offset table. The address … … 803 802 || ! bfd_set_section_flags (abfd, s, flags) 804 803 || ! bfd_set_section_alignment (abfd, s, 2)) 805 return false;804 return FALSE; 806 805 807 806 /* The .plt section holds the procedure linkage table. The … … 811 810 || ! bfd_set_section_flags (abfd, s, flags | SEC_CODE) 812 811 || ! bfd_set_section_alignment (abfd, s, 2)) 813 return false;812 return FALSE; 814 813 815 814 /* The .dynrel section holds the dynamic relocs. The address is … … 819 818 || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) 820 819 || ! bfd_set_section_alignment (abfd, s, 2)) 821 return false;820 return FALSE; 822 821 823 822 /* The .hash section holds the dynamic hash table. The address … … 827 826 || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) 828 827 || ! bfd_set_section_alignment (abfd, s, 2)) 829 return false;828 return FALSE; 830 829 831 830 /* The .dynsym section holds the dynamic symbols. The address … … 835 834 || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) 836 835 || ! bfd_set_section_alignment (abfd, s, 2)) 837 return false;836 return FALSE; 838 837 839 838 /* The .dynstr section holds the dynamic symbol string table. … … 843 842 || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) 844 843 || ! bfd_set_section_alignment (abfd, s, 2)) 845 return false;846 847 sunos_hash_table (info)->dynamic_sections_created = true;844 return FALSE; 845 846 sunos_hash_table (info)->dynamic_sections_created = TRUE; 848 847 } 849 848 … … 859 858 s->_raw_size = BYTES_IN_WORD; 860 859 861 sunos_hash_table (info)->dynamic_sections_needed = true;862 sunos_hash_table (info)->got_needed = true;863 } 864 865 return true;860 sunos_hash_table (info)->dynamic_sections_needed = TRUE; 861 sunos_hash_table (info)->got_needed = TRUE; 862 } 863 864 return TRUE; 866 865 } 867 866 … … 869 868 backend linker for each object it encounters. */ 870 869 871 static b oolean870 static bfd_boolean 872 871 sunos_add_dynamic_symbols (abfd, info, symsp, sym_countp, stringsp) 873 872 bfd *abfd; … … 877 876 char **stringsp; 878 877 { 879 asection *s;880 878 bfd *dynobj; 881 879 struct sunos_dynamic_info *dinfo; 882 880 unsigned long need; 881 asection **ps; 883 882 884 883 /* Make sure we have all the required sections. */ … … 886 885 { 887 886 if (! sunos_create_dynamic_sections (abfd, info, 888 (((abfd->flags & DYNAMIC) != 0 889 && ! info->relocateable) 890 ? true 891 : false))) 892 return false; 887 ((abfd->flags & DYNAMIC) != 0 888 && !info->relocateable))) 889 return FALSE; 893 890 } 894 891 895 892 /* There is nothing else to do for a normal object. */ 896 893 if ((abfd->flags & DYNAMIC) == 0) 897 return true;894 return TRUE; 898 895 899 896 dynobj = sunos_hash_table (info)->dynobj; … … 906 903 space in the output file. If this is the first object we have 907 904 seen, we must preserve the dynamic sections we just created. */ 908 if (abfd != dynobj) 909 abfd->sections = NULL; 910 else 911 { 912 asection *s; 913 914 for (s = abfd->sections; 915 (s->flags & SEC_LINKER_CREATED) == 0; 916 s = s->next) 917 ; 918 abfd->sections = s; 905 for (ps = &abfd->sections; *ps != NULL; ) 906 { 907 if (abfd != dynobj || ((*ps)->flags & SEC_LINKER_CREATED) == 0) 908 bfd_section_list_remove (abfd, ps); 909 else 910 ps = &(*ps)->next; 919 911 } 920 912 … … 922 914 used. */ 923 915 if (info->relocateable) 924 return true;916 return TRUE; 925 917 926 918 /* There's no hope of using a dynamic object which does not exactly … … 929 921 { 930 922 bfd_set_error (bfd_error_invalid_operation); 931 return false;923 return FALSE; 932 924 } 933 925 … … 940 932 which must be included at runtime. The address of this 941 933 section is put in the ld_need field. */ 942 s = bfd_make_section (dynobj, ".need");934 asection *s = bfd_make_section (dynobj, ".need"); 943 935 if (s == NULL 944 936 || ! bfd_set_section_flags (dynobj, s, … … 949 941 | SEC_READONLY)) 950 942 || ! bfd_set_section_alignment (dynobj, s, 2)) 951 return false;943 return FALSE; 952 944 } 953 945 … … 957 949 objects. The address of this section is put in the ld_rules 958 950 field. */ 959 s = bfd_make_section (dynobj, ".rules");951 asection *s = bfd_make_section (dynobj, ".rules"); 960 952 if (s == NULL 961 953 || ! bfd_set_section_flags (dynobj, s, … … 966 958 | SEC_READONLY)) 967 959 || ! bfd_set_section_alignment (dynobj, s, 2)) 968 return false;960 return FALSE; 969 961 } 970 962 971 963 /* Pick up the dynamic symbols and return them to the caller. */ 972 964 if (! sunos_slurp_dynamic_symtab (abfd)) 973 return false;965 return FALSE; 974 966 975 967 dinfo = (struct sunos_dynamic_info *) obj_aout_dynamic_info (abfd); … … 987 979 struct bfd_link_needed_list *needed, **pp; 988 980 char *namebuf, *p; 989 size_talc;981 bfd_size_type alc; 990 982 bfd_byte b; 991 983 char *namecopy; 992 984 993 if (bfd_seek (abfd, need, SEEK_SET) != 0994 || bfd_ read (buf, 1,16, abfd) != 16)995 return false;985 if (bfd_seek (abfd, (file_ptr) need, SEEK_SET) != 0 986 || bfd_bread (buf, (bfd_size_type) 16, abfd) != 16) 987 return FALSE; 996 988 997 989 /* For the format of an ld_need entry, see aout/sun4.h. We 998 990 should probably define structs for this manipulation. */ 999 991 1000 992 name = bfd_get_32 (abfd, buf); 1001 993 flags = bfd_get_32 (abfd, buf + 4); 1002 major_vno = (unsigned short) bfd_get_16 (abfd, buf + 8);1003 minor_vno = (unsigned short) bfd_get_16 (abfd, buf + 10);994 major_vno = (unsigned short) bfd_get_16 (abfd, buf + 8); 995 minor_vno = (unsigned short) bfd_get_16 (abfd, buf + 10); 1004 996 need = bfd_get_32 (abfd, buf + 12); 1005 997 1006 needed = ((struct bfd_link_needed_list *)1007 bfd_alloc (abfd, sizeof (struct bfd_link_needed_list)));998 alc = sizeof (struct bfd_link_needed_list); 999 needed = (struct bfd_link_needed_list *) bfd_alloc (abfd, alc); 1008 1000 if (needed == NULL) 1009 return false;1001 return FALSE; 1010 1002 needed->by = abfd; 1011 1003 … … 1014 1006 namebuf = (char *) bfd_malloc (alc + 1); 1015 1007 if (namebuf == NULL) 1016 return false;1008 return FALSE; 1017 1009 p = namebuf; 1018 1010 … … 1022 1014 *p++ = 'l'; 1023 1015 } 1024 if (bfd_seek (abfd, name, SEEK_SET) != 0)1016 if (bfd_seek (abfd, (file_ptr) name, SEEK_SET) != 0) 1025 1017 { 1026 1018 free (namebuf); 1027 return false;1019 return FALSE; 1028 1020 } 1029 1021 1030 1022 do 1031 1023 { 1032 if (bfd_ read (&b, 1,1, abfd) != 1)1024 if (bfd_bread (&b, (bfd_size_type) 1, abfd) != 1) 1033 1025 { 1034 1026 free (namebuf); 1035 return false;1027 return FALSE; 1036 1028 } 1037 1029 1038 if (( size_t) (p - namebuf) >= alc)1030 if ((bfd_size_type) (p - namebuf) >= alc) 1039 1031 { 1040 1032 char *n; … … 1045 1037 { 1046 1038 free (namebuf); 1047 return false;1039 return FALSE; 1048 1040 } 1049 1041 p = n + (p - namebuf); … … 1077 1069 { 1078 1070 free (namebuf); 1079 return false;1071 return FALSE; 1080 1072 } 1081 1073 p = n + (p - namebuf); … … 1087 1079 } 1088 1080 1089 namecopy = bfd_alloc (abfd, strlen (namebuf) + 1);1081 namecopy = bfd_alloc (abfd, (bfd_size_type) strlen (namebuf) + 1); 1090 1082 if (namecopy == NULL) 1091 1083 { 1092 1084 free (namebuf); 1093 return false;1085 return FALSE; 1094 1086 } 1095 1087 strcpy (namecopy, namebuf); … … 1106 1098 } 1107 1099 1108 return true;1100 return TRUE; 1109 1101 } 1110 1102 … … 1113 1105 tweaking needed for dynamic linking support. */ 1114 1106 1115 static b oolean1107 static bfd_boolean 1116 1108 sunos_add_one_symbol (info, abfd, name, flags, section, value, string, 1117 1109 copy, collect, hashp) … … 1123 1115 bfd_vma value; 1124 1116 const char *string; 1125 b oolean copy;1126 b oolean collect;1117 bfd_boolean copy; 1118 bfd_boolean collect; 1127 1119 struct bfd_link_hash_entry **hashp; 1128 1120 { … … 1132 1124 if ((flags & (BSF_INDIRECT | BSF_WARNING | BSF_CONSTRUCTOR)) != 0 1133 1125 || ! bfd_is_und_section (section)) 1134 h = sunos_link_hash_lookup (sunos_hash_table (info), name, true, copy,1135 false);1126 h = sunos_link_hash_lookup (sunos_hash_table (info), name, TRUE, copy, 1127 FALSE); 1136 1128 else 1137 1129 h = ((struct sunos_link_hash_entry *) 1138 bfd_wrapped_link_hash_lookup (abfd, info, name, true, copy, false));1130 bfd_wrapped_link_hash_lookup (abfd, info, name, TRUE, copy, FALSE)); 1139 1131 if (h == NULL) 1140 return false;1132 return FALSE; 1141 1133 1142 1134 if (hashp != NULL) … … 1192 1184 { 1193 1185 /* The existing symbol is a constructor symbol, and this symbol 1194 1195 1196 1197 1186 is from a dynamic object. A constructor symbol is actually a 1187 definition, although the type will be bfd_link_hash_undefined 1188 at this point. We want to ignore the definition from the 1189 dynamic object. */ 1198 1190 section = bfd_und_section_ptr; 1199 1191 } … … 1205 1197 { 1206 1198 /* The existing symbol is defined by a dynamic object, and this 1207 1208 1199 is a constructor symbol. As above, we want to force the use 1200 of the constructor symbol from the regular object. */ 1209 1201 h->root.root.type = bfd_link_hash_new; 1210 1202 } … … 1214 1206 value, string, copy, collect, 1215 1207 hashp)) 1216 return false;1208 return FALSE; 1217 1209 1218 1210 if (abfd->xvec == info->hash->creator) … … 1251 1243 } 1252 1244 1253 return true;1245 return TRUE; 1254 1246 } 1255 1247 … … 1270 1262 this in case some dynamic object refers to this symbol. */ 1271 1263 1272 b oolean1264 bfd_boolean 1273 1265 bfd_sunos_record_link_assignment (output_bfd, info, name) 1274 1266 bfd *output_bfd; … … 1279 1271 1280 1272 if (output_bfd->xvec != &MY(vec)) 1281 return true;1273 return TRUE; 1282 1274 1283 1275 /* This is called after we have examined all the input objects. If … … 1285 1277 to it, and we can just ignore it at this point. */ 1286 1278 h = sunos_link_hash_lookup (sunos_hash_table (info), name, 1287 false, false, false);1279 FALSE, FALSE, FALSE); 1288 1280 if (h == NULL) 1289 return true;1281 return TRUE; 1290 1282 1291 1283 /* In a shared library, the __DYNAMIC symbol does not appear in the … … 1302 1294 } 1303 1295 1304 return true;1296 return TRUE; 1305 1297 } 1306 1298 … … 1311 1303 sections. This unfortunately requires reading all the relocs so 1312 1304 that we can work out which ones need to become dynamic relocs. If 1313 info->keep_memory is true, we keep the relocs in memory; otherwise,1305 info->keep_memory is TRUE, we keep the relocs in memory; otherwise, 1314 1306 we discard them, and will read them again later. */ 1315 1307 1316 b oolean1308 bfd_boolean 1317 1309 bfd_sunos_size_dynamic_sections (output_bfd, info, sdynptr, sneedptr, 1318 1310 srulesptr) … … 1324 1316 { 1325 1317 bfd *dynobj; 1326 size_tdynsymcount;1318 bfd_size_type dynsymcount; 1327 1319 struct sunos_link_hash_entry *h; 1328 1320 asection *s; 1329 1321 size_t bucketcount; 1330 size_thashalloc;1322 bfd_size_type hashalloc; 1331 1323 size_t i; 1332 1324 bfd *sub; … … 1337 1329 1338 1330 if (info->relocateable) 1339 return true;1331 return TRUE; 1340 1332 1341 1333 if (output_bfd->xvec != &MY(vec)) 1342 return true;1334 return TRUE; 1343 1335 1344 1336 /* Look through all the input BFD's and read their relocs. It would … … 1356 1348 || ! sunos_scan_relocs (info, sub, obj_datasec (sub), 1357 1349 exec_hdr (sub)->a_drsize)) 1358 return false;1350 return FALSE; 1359 1351 } 1360 1352 } … … 1367 1359 if (! sunos_hash_table (info)->dynamic_sections_needed 1368 1360 && ! sunos_hash_table (info)->got_needed) 1369 return true;1361 return TRUE; 1370 1362 1371 1363 /* If __GLOBAL_OFFSET_TABLE_ was mentioned, define it. */ 1372 1364 h = sunos_link_hash_lookup (sunos_hash_table (info), 1373 "__GLOBAL_OFFSET_TABLE_", false, false, false);1365 "__GLOBAL_OFFSET_TABLE_", FALSE, FALSE, FALSE); 1374 1366 if (h != NULL && (h->flags & SUNOS_REF_REGULAR) != 0) 1375 1367 { … … 1384 1376 1385 1377 /* If the .got section is more than 0x1000 bytes, we set 1386 1387 1378 __GLOBAL_OFFSET_TABLE_ to be 0x1000 bytes into the section, 1379 so that 13 bit relocations have a greater chance of working. */ 1388 1380 s = bfd_get_section_by_name (dynobj, ".got"); 1389 1381 BFD_ASSERT (s != NULL); … … 1422 1414 s->contents = (bfd_byte *) bfd_alloc (output_bfd, s->_raw_size); 1423 1415 if (s->contents == NULL && s->_raw_size != 0) 1424 return false;1416 return FALSE; 1425 1417 1426 1418 /* The number of buckets is just the number of symbols divided … … 1441 1433 BFD_ASSERT (s != NULL); 1442 1434 hashalloc = (dynsymcount + bucketcount - 1) * HASH_ENTRY_SIZE; 1443 s->contents = (bfd_byte *) bfd_ alloc (dynobj, hashalloc);1435 s->contents = (bfd_byte *) bfd_zalloc (dynobj, hashalloc); 1444 1436 if (s->contents == NULL && dynsymcount > 0) 1445 return false; 1446 memset (s->contents, 0, hashalloc); 1437 return FALSE; 1447 1438 for (i = 0; i < bucketcount; i++) 1448 1439 PUT_WORD (output_bfd, (bfd_vma) -1, s->contents + i * HASH_ENTRY_SIZE); … … 1472 1463 add = 8 - (s->_raw_size & 7); 1473 1464 contents = (bfd_byte *) bfd_realloc (s->contents, 1474 (size_t) (s->_raw_size + add));1465 s->_raw_size + add); 1475 1466 if (contents == NULL) 1476 return false;1467 return FALSE; 1477 1468 memset (contents + s->_raw_size, 0, (size_t) add); 1478 1469 s->contents = contents; … … 1489 1480 s->contents = (bfd_byte *) bfd_alloc (dynobj, s->_raw_size); 1490 1481 if (s->contents == NULL) 1491 return false;1482 return FALSE; 1492 1483 1493 1484 /* Fill in the first entry in the table. */ … … 1512 1503 s->contents = (bfd_byte *) bfd_alloc (dynobj, s->_raw_size); 1513 1504 if (s->contents == NULL) 1514 return false;1505 return FALSE; 1515 1506 } 1516 1507 /* We use the reloc_count field to keep track of how many of the … … 1522 1513 s->contents = (bfd_byte *) bfd_alloc (dynobj, s->_raw_size); 1523 1514 if (s->contents == NULL) 1524 return false;1515 return FALSE; 1525 1516 1526 1517 *sneedptr = bfd_get_section_by_name (dynobj, ".need"); 1527 1518 *srulesptr = bfd_get_section_by_name (dynobj, ".rules"); 1528 1519 1529 return true;1520 return TRUE; 1530 1521 } 1531 1522 1532 1523 /* Scan the relocs for an input section. */ 1533 1524 1534 static b oolean1525 static bfd_boolean 1535 1526 sunos_scan_relocs (info, abfd, sec, rel_size) 1536 1527 struct bfd_link_info *info; … … 1543 1534 1544 1535 if (rel_size == 0) 1545 return true;1536 return TRUE; 1546 1537 1547 1538 if (! info->keep_memory) 1548 relocs = free_relocs = bfd_malloc ( (size_t)rel_size);1539 relocs = free_relocs = bfd_malloc (rel_size); 1549 1540 else 1550 1541 { 1551 1542 struct aout_section_data_struct *n; 1552 1553 n = ((struct aout_section_data_struct *) 1554 bfd_alloc (abfd, sizeof (struct aout_section_data_struct)));1543 bfd_size_type amt = sizeof (struct aout_section_data_struct); 1544 1545 n = (struct aout_section_data_struct *) bfd_alloc (abfd, amt); 1555 1546 if (n == NULL) 1556 1547 relocs = NULL; … … 1558 1549 { 1559 1550 set_aout_section_data (sec, n); 1560 relocs = bfd_malloc ( (size_t)rel_size);1551 relocs = bfd_malloc (rel_size); 1561 1552 aout_section_data (sec)->relocs = relocs; 1562 1553 } 1563 1554 } 1564 1555 if (relocs == NULL) 1565 return false;1556 return FALSE; 1566 1557 1567 1558 if (bfd_seek (abfd, sec->rel_filepos, SEEK_SET) != 0 1568 || bfd_ read (relocs, 1, rel_size, abfd) != rel_size)1559 || bfd_bread (relocs, rel_size, abfd) != rel_size) 1569 1560 goto error_return; 1570 1561 … … 1587 1578 free (free_relocs); 1588 1579 1589 return true;1580 return TRUE; 1590 1581 1591 1582 error_return: 1592 1583 if (free_relocs != NULL) 1593 1584 free (free_relocs); 1594 return false;1585 return FALSE; 1595 1586 } 1596 1587 … … 1605 1596 building global offset table entries. */ 1606 1597 1607 static b oolean1598 static bfd_boolean 1608 1599 sunos_scan_std_relocs (info, abfd, sec, relocs, rel_size) 1609 1600 struct bfd_link_info *info; … … 1623 1614 { 1624 1615 bfd_set_error (bfd_error_invalid_target); 1625 return false;1616 return FALSE; 1626 1617 } 1627 1618 … … 1685 1676 asection *sgot; 1686 1677 1687 if (! sunos_create_dynamic_sections (abfd, info, false))1688 return false;1678 if (! sunos_create_dynamic_sections (abfd, info, FALSE)) 1679 return FALSE; 1689 1680 dynobj = sunos_hash_table (info)->dynobj; 1690 1681 splt = bfd_get_section_by_name (dynobj, ".plt"); … … 1696 1687 if (sgot->_raw_size == 0) 1697 1688 sgot->_raw_size = BYTES_IN_WORD; 1698 sunos_hash_table (info)->got_needed = true;1689 sunos_hash_table (info)->got_needed = TRUE; 1699 1690 } 1700 1691 … … 1756 1747 } 1757 1748 1758 return true;1749 return TRUE; 1759 1750 } 1760 1751 … … 1765 1756 Otherwise, we must preserve the reloc as a dynamic reloc. */ 1766 1757 1767 static b oolean1758 static bfd_boolean 1768 1759 sunos_scan_ext_relocs (info, abfd, sec, relocs, rel_size) 1769 1760 struct bfd_link_info *info; … … 1779 1770 asection *sgot = NULL; 1780 1771 asection *srel = NULL; 1772 bfd_size_type amt; 1781 1773 1782 1774 /* We only know how to handle SPARC plt entries. */ … … 1784 1776 { 1785 1777 bfd_set_error (bfd_error_invalid_target); 1786 return false;1778 return FALSE; 1787 1779 } 1788 1780 … … 1831 1823 1832 1824 /* If this is a base relative reloc, we need to make an entry in 1833 1825 the .got section. */ 1834 1826 if (r_type == RELOC_BASE10 1835 1827 || r_type == RELOC_BASE13 … … 1838 1830 if (dynobj == NULL) 1839 1831 { 1840 if (! sunos_create_dynamic_sections (abfd, info, false))1841 return false;1832 if (! sunos_create_dynamic_sections (abfd, info, FALSE)) 1833 return FALSE; 1842 1834 dynobj = sunos_hash_table (info)->dynobj; 1843 1835 splt = bfd_get_section_by_name (dynobj, ".plt"); … … 1849 1841 if (sgot->_raw_size == 0) 1850 1842 sgot->_raw_size = BYTES_IN_WORD; 1851 sunos_hash_table (info)->got_needed = true;1843 sunos_hash_table (info)->got_needed = TRUE; 1852 1844 } 1853 1845 … … 1870 1862 if (adata (abfd).local_got_offsets == NULL) 1871 1863 { 1864 amt = bfd_get_symcount (abfd); 1865 amt *= sizeof (bfd_vma); 1872 1866 adata (abfd).local_got_offsets = 1873 (bfd_vma *) bfd_zalloc (abfd, 1874 (bfd_get_symcount (abfd) 1875 * sizeof (bfd_vma))); 1867 (bfd_vma *) bfd_zalloc (abfd, amt); 1876 1868 if (adata (abfd).local_got_offsets == NULL) 1877 return false;1869 return FALSE; 1878 1870 } 1879 1871 … … 1899 1891 1900 1892 /* Otherwise, we are only interested in relocs against symbols 1901 1902 1893 defined in dynamic objects but not in regular objects. We 1894 only need to consider relocs against external symbols. */ 1903 1895 if (! r_extern) 1904 1896 { 1905 1897 /* But, if we are creating a shared library, we need to 1906 1898 generate an absolute reloc. */ 1907 1899 if (info->shared) 1908 1900 { 1909 1901 if (dynobj == NULL) 1910 1902 { 1911 if (! sunos_create_dynamic_sections (abfd, info, true))1912 return false;1903 if (! sunos_create_dynamic_sections (abfd, info, TRUE)) 1904 return FALSE; 1913 1905 dynobj = sunos_hash_table (info)->dynobj; 1914 1906 splt = bfd_get_section_by_name (dynobj, ".plt"); … … 1946 1938 { 1947 1939 /* This symbol is apparently undefined. Don't do anything 1948 1949 1940 here; just let the relocation routine report an undefined 1941 symbol. */ 1950 1942 continue; 1951 1943 } … … 1956 1948 if (dynobj == NULL) 1957 1949 { 1958 if (! sunos_create_dynamic_sections (abfd, info, false))1959 return false;1950 if (! sunos_create_dynamic_sections (abfd, info, FALSE)) 1951 return FALSE; 1960 1952 dynobj = sunos_hash_table (info)->dynobj; 1961 1953 splt = bfd_get_section_by_name (dynobj, ".plt"); … … 1967 1959 if (sgot->_raw_size == 0) 1968 1960 sgot->_raw_size = BYTES_IN_WORD; 1969 sunos_hash_table (info)->got_needed = true;1961 sunos_hash_table (info)->got_needed = TRUE; 1970 1962 } 1971 1963 … … 2032 2024 2033 2025 /* We will also need a dynamic reloc entry, unless this 2034 2035 2026 is a JMP_TBL reloc produced by linking PIC compiled 2027 code, and we are not making a shared library. */ 2036 2028 if (info->shared || (h->flags & SUNOS_DEF_REGULAR) == 0) 2037 2029 srel->_raw_size += RELOC_EXT_SIZE; … … 2039 2031 2040 2032 /* If we are creating a shared library, we need to copy over 2041 2033 any reloc other than a jump table reloc. */ 2042 2034 if (info->shared && r_type != RELOC_JMP_TBL) 2043 2035 srel->_raw_size += RELOC_EXT_SIZE; … … 2045 2037 } 2046 2038 2047 return true;2039 return TRUE; 2048 2040 } 2049 2041 … … 2051 2043 symbols from dynamic objects which we do not plan to write out. */ 2052 2044 2053 static b oolean2045 static bfd_boolean 2054 2046 sunos_scan_dynamic_symbol (h, data) 2055 2047 struct sunos_link_hash_entry *h; … … 2057 2049 { 2058 2050 struct bfd_link_info *info = (struct bfd_link_info *) data; 2051 2052 if (h->root.root.type == bfd_link_hash_warning) 2053 h = (struct sunos_link_hash_entry *) h->root.root.u.i.link; 2059 2054 2060 2055 /* Set the written flag for symbols we do not want to write out as … … 2070 2065 && (h->flags & SUNOS_DEF_DYNAMIC) != 0 2071 2066 && strcmp (h->root.root.root.string, "__DYNAMIC") != 0) 2072 h->root.written = true;2067 h->root.written = TRUE; 2073 2068 2074 2069 /* If this symbol is defined by a dynamic object and referenced by a … … 2129 2124 s->_raw_size + len + 1); 2130 2125 if (contents == NULL) 2131 return false;2126 return FALSE; 2132 2127 s->contents = contents; 2133 2128 … … 2165 2160 } 2166 2161 2167 return true;2162 return TRUE; 2168 2163 } 2169 2164 … … 2173 2168 2174 2169 /*ARGSUSED*/ 2175 static b oolean2170 static bfd_boolean 2176 2171 sunos_link_dynamic_object (info, abfd) 2177 2172 struct bfd_link_info *info ATTRIBUTE_UNUSED; 2178 2173 bfd *abfd ATTRIBUTE_UNUSED; 2179 2174 { 2180 return true;2175 return TRUE; 2181 2176 } 2182 2177 … … 2184 2179 over the symbol table. */ 2185 2180 2186 static b oolean2181 static bfd_boolean 2187 2182 sunos_write_dynamic_symbol (output_bfd, info, harg) 2188 2183 bfd *output_bfd; … … 2203 2198 asection *splt; 2204 2199 bfd_byte *p; 2205 asection *s;2206 2200 bfd_vma r_address; 2207 2201 … … 2232 2226 else 2233 2227 { 2234 bfd_vma val;2235 2236 2228 val = (h->root.root.u.def.section->output_section->vma 2237 2229 + h->root.root.u.def.section->output_offset … … 2252 2244 bfd_put_16 (output_bfd, M68K_PLT_ENTRY_WORD0, p); 2253 2245 bfd_put_32 (output_bfd, (- (h->plt_offset + 2)), p + 2); 2254 bfd_put_16 (output_bfd, s->reloc_count, p + 6);2246 bfd_put_16 (output_bfd, (bfd_vma) s->reloc_count, p + 6); 2255 2247 r_address += 2; 2256 2248 break; … … 2261 2253 2262 2254 /* We also need to add a jump table reloc, unless this is the 2263 2255 result of a JMP_TBL reloc from PIC compiled code. */ 2264 2256 if (info->shared || (h->flags & SUNOS_DEF_REGULAR) == 0) 2265 2257 { … … 2327 2319 compiled code from a regular object. */ 2328 2320 if (h->dynindx < 0) 2329 return true;2321 return TRUE; 2330 2322 2331 2323 switch (h->root.root.type) … … 2335 2327 abort (); 2336 2328 /* Avoid variable not initialized warnings. */ 2337 return true;2329 return TRUE; 2338 2330 case bfd_link_hash_undefined: 2339 2331 type = N_UNDF | N_EXT; … … 2393 2385 /* FIXME: Ignore these for now. The circumstances under which 2394 2386 they should be written out are not clear to me. */ 2395 return true;2387 return TRUE; 2396 2388 } 2397 2389 … … 2401 2393 (s->contents + h->dynindx * EXTERNAL_NLIST_SIZE)); 2402 2394 2403 bfd_h_put_8 (output_bfd, type, outsym->e_type);2404 bfd_h_put_8 (output_bfd, 0, outsym->e_other);2395 H_PUT_8 (output_bfd, type, outsym->e_type); 2396 H_PUT_8 (output_bfd, 0, outsym->e_other); 2405 2397 2406 2398 /* FIXME: The native linker doesn't use 0 for desc. It seems to use 2407 2399 one less than the desc value in the shared library, although that 2408 2400 seems unlikely. */ 2409 bfd_h_put_16 (output_bfd, 0, outsym->e_desc);2401 H_PUT_16 (output_bfd, 0, outsym->e_desc); 2410 2402 2411 2403 PUT_WORD (output_bfd, h->dynstr_index, outsym->e_strx); 2412 2404 PUT_WORD (output_bfd, val, outsym->e_value); 2413 2405 2414 return true;2406 return TRUE; 2415 2407 } 2416 2408 … … 2421 2413 2422 2414 /*ARGSUSED*/ 2423 static b oolean2415 static bfd_boolean 2424 2416 sunos_check_dynamic_reloc (info, input_bfd, input_section, harg, reloc, 2425 2417 contents, skip, relocationp) … … 2430 2422 PTR reloc; 2431 2423 bfd_byte *contents ATTRIBUTE_UNUSED; 2432 b oolean *skip;2424 bfd_boolean *skip; 2433 2425 bfd_vma *relocationp; 2434 2426 { 2435 2427 struct sunos_link_hash_entry *h = (struct sunos_link_hash_entry *) harg; 2436 2428 bfd *dynobj; 2437 b oolean baserel;2438 b oolean jmptbl;2439 b oolean pcrel;2429 bfd_boolean baserel; 2430 bfd_boolean jmptbl; 2431 bfd_boolean pcrel; 2440 2432 asection *s; 2441 2433 bfd_byte *p; 2442 2434 long indx; 2443 2435 2444 *skip = false;2436 *skip = FALSE; 2445 2437 2446 2438 dynobj = sunos_hash_table (info)->dynobj; … … 2500 2492 || r_type == RELOC_WDISP22); 2501 2493 /* We don't consider the PC10 and PC22 types to be PC relative, 2502 2494 because they are pcrel_offset. */ 2503 2495 } 2504 2496 … … 2569 2561 { 2570 2562 /* We need to create a GLOB_DAT or 32 reloc to tell the 2571 2563 dynamic linker to fill in this entry in the table. */ 2572 2564 2573 2565 s = bfd_get_section_by_name (dynobj, ".dynrel"); … … 2670 2662 2671 2663 *relocationp = (sgot->vma 2672 + (*got_offsetp &~ 1)2664 + (*got_offsetp &~ (bfd_vma) 1) 2673 2665 - sunos_hash_table (info)->got_base); 2674 2666 2675 2667 /* There is nothing else to do for a base relative reloc. */ 2676 return true;2668 return TRUE; 2677 2669 } 2678 2670 2679 2671 if (! sunos_hash_table (info)->dynamic_sections_needed) 2680 return true;2672 return TRUE; 2681 2673 if (! info->shared) 2682 2674 { … … 2687 2679 || (h->flags & SUNOS_DEF_DYNAMIC) == 0 2688 2680 || (h->root.root.u.undef.abfd->flags & DYNAMIC) == 0) 2689 return true;2681 return TRUE; 2690 2682 } 2691 2683 else … … 2696 2688 || strcmp (h->root.root.root.string, 2697 2689 "__GLOBAL_OFFSET_TABLE_") == 0)) 2698 return true;2690 return TRUE; 2699 2691 } 2700 2692 … … 2739 2731 } 2740 2732 /* FIXME: We may have to change the addend for a PC relative 2741 2733 reloc. */ 2742 2734 } 2743 2735 else … … 2778 2770 2779 2771 if (h != NULL) 2780 *skip = true;2781 2782 return true;2772 *skip = TRUE; 2773 2774 return TRUE; 2783 2775 } 2784 2776 2785 2777 /* Finish up the dynamic linking information. */ 2786 2778 2787 static b oolean2779 static bfd_boolean 2788 2780 sunos_finish_dynamic_link (abfd, info) 2789 2781 bfd *abfd; … … 2797 2789 if (! sunos_hash_table (info)->dynamic_sections_needed 2798 2790 && ! sunos_hash_table (info)->got_needed) 2799 return true;2791 return TRUE; 2800 2792 2801 2793 dynobj = sunos_hash_table (info)->dynobj; … … 2847 2839 && o->output_section->owner == abfd); 2848 2840 if (! bfd_set_section_contents (abfd, o->output_section, 2849 o->contents, o->output_offset, 2841 o->contents, 2842 (file_ptr) o->output_offset, 2850 2843 o->_raw_size)) 2851 return false;2844 return FALSE; 2852 2845 } 2853 2846 } … … 2857 2850 struct external_sun4_dynamic esd; 2858 2851 struct external_sun4_dynamic_link esdl; 2852 file_ptr pos; 2859 2853 2860 2854 /* Finish up the dynamic link information. */ … … 2871 2865 2872 2866 if (! bfd_set_section_contents (abfd, sdyn->output_section, &esd, 2873 sdyn->output_offset, sizeof esd)) 2874 return false; 2867 (file_ptr) sdyn->output_offset, 2868 (bfd_size_type) sizeof esd)) 2869 return FALSE; 2875 2870 2876 2871 PUT_WORD (dynobj, (bfd_vma) 0, esdl.ld_loaded); … … 2936 2931 esdl.ld_text); 2937 2932 2933 pos = sdyn->output_offset; 2934 pos += sizeof esd + EXTERNAL_SUN4_DYNAMIC_DEBUGGER_SIZE; 2938 2935 if (! bfd_set_section_contents (abfd, sdyn->output_section, &esdl, 2939 (sdyn->output_offset 2940 + sizeof esd 2941 + EXTERNAL_SUN4_DYNAMIC_DEBUGGER_SIZE), 2942 sizeof esdl)) 2943 return false; 2936 pos, (bfd_size_type) sizeof esdl)) 2937 return FALSE; 2944 2938 2945 2939 abfd->flags |= DYNAMIC; 2946 2940 } 2947 2941 2948 return true;2942 return TRUE; 2949 2943 } -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.