diff options
author | Alan Modra <amodra@gmail.com> | 2002-11-30 08:39:46 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2002-11-30 08:39:46 +0000 |
commit | b34976b65aea8f33690229600bbf4527ec3118e1 (patch) | |
tree | 6411348664ef81ca2aa2e3ff325116e6e6502edf /bfd/som.c | |
parent | 583d52d728c60410c0d39bae68ee536a7b9e7a6c (diff) | |
download | gdb-b34976b65aea8f33690229600bbf4527ec3118e1.zip gdb-b34976b65aea8f33690229600bbf4527ec3118e1.tar.gz gdb-b34976b65aea8f33690229600bbf4527ec3118e1.tar.bz2 |
s/boolean/bfd_boolean/ s/true/TRUE/ s/false/FALSE/. Simplify
comparisons of bfd_boolean vars with TRUE/FALSE. Formatting.
Diffstat (limited to 'bfd/som.c')
-rw-r--r-- | bfd/som.c | 663 |
1 files changed, 345 insertions, 318 deletions
@@ -150,122 +150,149 @@ struct som_misc_symbol_info { /* Forward declarations */ -static boolean som_mkobject PARAMS ((bfd *)); -static const bfd_target * som_object_setup PARAMS ((bfd *, - struct header *, - struct som_exec_auxhdr *, - unsigned long)); -static boolean setup_sections PARAMS ((bfd *, struct header *, unsigned long)); -static const bfd_target * som_object_p PARAMS ((bfd *)); -static boolean som_write_object_contents PARAMS ((bfd *)); -static boolean som_slurp_string_table PARAMS ((bfd *)); -static unsigned int som_slurp_symbol_table PARAMS ((bfd *)); -static long som_get_symtab_upper_bound PARAMS ((bfd *)); -static long som_canonicalize_reloc PARAMS ((bfd *, sec_ptr, - arelent **, asymbol **)); -static long som_get_reloc_upper_bound PARAMS ((bfd *, sec_ptr)); -static unsigned int som_set_reloc_info PARAMS ((unsigned char *, unsigned int, - arelent *, asection *, - asymbol **, boolean)); -static boolean som_slurp_reloc_table PARAMS ((bfd *, asection *, - asymbol **, boolean)); -static long som_get_symtab PARAMS ((bfd *, asymbol **)); -static asymbol * som_make_empty_symbol PARAMS ((bfd *)); -static void som_print_symbol PARAMS ((bfd *, PTR, - asymbol *, bfd_print_symbol_type)); -static boolean som_new_section_hook PARAMS ((bfd *, asection *)); -static boolean som_bfd_copy_private_symbol_data PARAMS ((bfd *, asymbol *, - bfd *, asymbol *)); -static boolean som_bfd_copy_private_section_data PARAMS ((bfd *, asection *, - bfd *, asection *)); -static boolean som_bfd_copy_private_bfd_data PARAMS ((bfd *, bfd *)); +static bfd_boolean som_mkobject + PARAMS ((bfd *)); +static const bfd_target * som_object_setup + PARAMS ((bfd *, struct header *, struct som_exec_auxhdr *, unsigned long)); +static bfd_boolean setup_sections + PARAMS ((bfd *, struct header *, unsigned long)); +static const bfd_target * som_object_p + PARAMS ((bfd *)); +static bfd_boolean som_write_object_contents + PARAMS ((bfd *)); +static bfd_boolean som_slurp_string_table + PARAMS ((bfd *)); +static unsigned int som_slurp_symbol_table + PARAMS ((bfd *)); +static long som_get_symtab_upper_bound + PARAMS ((bfd *)); +static long som_canonicalize_reloc + PARAMS ((bfd *, sec_ptr, arelent **, asymbol **)); +static long som_get_reloc_upper_bound + PARAMS ((bfd *, sec_ptr)); +static unsigned int som_set_reloc_info + PARAMS ((unsigned char *, unsigned int, arelent *, asection *, + asymbol **, bfd_boolean)); +static bfd_boolean som_slurp_reloc_table + PARAMS ((bfd *, asection *, asymbol **, bfd_boolean)); +static long som_get_symtab + PARAMS ((bfd *, asymbol **)); +static asymbol * som_make_empty_symbol + PARAMS ((bfd *)); +static void som_print_symbol + PARAMS ((bfd *, PTR, asymbol *, bfd_print_symbol_type)); +static bfd_boolean som_new_section_hook + PARAMS ((bfd *, asection *)); +static bfd_boolean som_bfd_copy_private_symbol_data + PARAMS ((bfd *, asymbol *, bfd *, asymbol *)); +static bfd_boolean som_bfd_copy_private_section_data + PARAMS ((bfd *, asection *, bfd *, asection *)); +static bfd_boolean som_bfd_copy_private_bfd_data + PARAMS ((bfd *, bfd *)); #define som_bfd_merge_private_bfd_data _bfd_generic_bfd_merge_private_bfd_data #define som_bfd_set_private_flags _bfd_generic_bfd_set_private_flags -static boolean som_bfd_is_local_label_name PARAMS ((bfd *, const char *)); -static boolean som_set_section_contents PARAMS ((bfd *, sec_ptr, PTR, - file_ptr, bfd_size_type)); -static boolean som_get_section_contents PARAMS ((bfd *, sec_ptr, PTR, - file_ptr, bfd_size_type)); -static boolean som_set_arch_mach PARAMS ((bfd *, enum bfd_architecture, - unsigned long)); -static boolean som_find_nearest_line PARAMS ((bfd *, asection *, - asymbol **, bfd_vma, - const char **, - const char **, - unsigned int *)); -static void som_get_symbol_info PARAMS ((bfd *, asymbol *, symbol_info *)); -static asection * bfd_section_from_som_symbol PARAMS ((bfd *, - struct symbol_dictionary_record *)); -static int log2 PARAMS ((unsigned int)); -static bfd_reloc_status_type hppa_som_reloc PARAMS ((bfd *, arelent *, - asymbol *, PTR, - asection *, bfd *, - char **)); -static void som_initialize_reloc_queue PARAMS ((struct reloc_queue *)); -static void som_reloc_queue_insert PARAMS ((unsigned char *, unsigned int, - struct reloc_queue *)); -static void som_reloc_queue_fix PARAMS ((struct reloc_queue *, unsigned int)); -static int som_reloc_queue_find PARAMS ((unsigned char *, unsigned int, - struct reloc_queue *)); -static unsigned char * try_prev_fixup PARAMS ((bfd *, int *, unsigned char *, - unsigned int, - struct reloc_queue *)); - -static unsigned char * som_reloc_skip PARAMS ((bfd *, unsigned int, - unsigned char *, unsigned int *, - struct reloc_queue *)); -static unsigned char * som_reloc_addend PARAMS ((bfd *, bfd_vma, - unsigned char *, - unsigned int *, - struct reloc_queue *)); -static unsigned char * som_reloc_call PARAMS ((bfd *, unsigned char *, - unsigned int *, - arelent *, int, - struct reloc_queue *)); -static unsigned long som_count_spaces PARAMS ((bfd *)); -static unsigned long som_count_subspaces PARAMS ((bfd *)); -static int compare_syms PARAMS ((const void *, const void *)); -static int compare_subspaces PARAMS ((const void *, const void *)); -static unsigned long som_compute_checksum PARAMS ((bfd *)); -static boolean som_prep_headers PARAMS ((bfd *)); -static int som_sizeof_headers PARAMS ((bfd *, boolean)); -static boolean som_finish_writing PARAMS ((bfd *)); -static boolean som_build_and_write_symbol_table PARAMS ((bfd *)); -static void som_prep_for_fixups PARAMS ((bfd *, asymbol **, unsigned long)); -static boolean som_write_fixups PARAMS ((bfd *, unsigned long, unsigned int *)); -static boolean som_write_space_strings PARAMS ((bfd *, unsigned long, - unsigned int *)); -static boolean som_write_symbol_strings PARAMS ((bfd *, unsigned long, - asymbol **, unsigned int, - unsigned *, - COMPUNIT *)); -static boolean som_begin_writing PARAMS ((bfd *)); +static bfd_boolean som_bfd_is_local_label_name + PARAMS ((bfd *, const char *)); +static bfd_boolean som_set_section_contents + PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type)); +static bfd_boolean som_get_section_contents + PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type)); +static bfd_boolean som_set_arch_mach + PARAMS ((bfd *, enum bfd_architecture, unsigned long)); +static bfd_boolean som_find_nearest_line + PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **, + const char **, unsigned int *)); +static void som_get_symbol_info + PARAMS ((bfd *, asymbol *, symbol_info *)); +static asection * bfd_section_from_som_symbol + PARAMS ((bfd *, struct symbol_dictionary_record *)); +static int log2 + PARAMS ((unsigned int)); +static bfd_reloc_status_type hppa_som_reloc + PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); +static void som_initialize_reloc_queue + PARAMS ((struct reloc_queue *)); +static void som_reloc_queue_insert + PARAMS ((unsigned char *, unsigned int, struct reloc_queue *)); +static void som_reloc_queue_fix + PARAMS ((struct reloc_queue *, unsigned int)); +static int som_reloc_queue_find + PARAMS ((unsigned char *, unsigned int, struct reloc_queue *)); +static unsigned char * try_prev_fixup + PARAMS ((bfd *, int *, unsigned char *, unsigned int, struct reloc_queue *)); + +static unsigned char * som_reloc_skip + PARAMS ((bfd *, unsigned int, unsigned char *, unsigned int *, + struct reloc_queue *)); +static unsigned char * som_reloc_addend + PARAMS ((bfd *, bfd_vma, unsigned char *, unsigned int *, + struct reloc_queue *)); +static unsigned char * som_reloc_call + PARAMS ((bfd *, unsigned char *, unsigned int *, arelent *, int, + struct reloc_queue *)); +static unsigned long som_count_spaces + PARAMS ((bfd *)); +static unsigned long som_count_subspaces + PARAMS ((bfd *)); +static int compare_syms + PARAMS ((const void *, const void *)); +static int compare_subspaces + PARAMS ((const void *, const void *)); +static unsigned long som_compute_checksum + PARAMS ((bfd *)); +static bfd_boolean som_prep_headers + PARAMS ((bfd *)); +static int som_sizeof_headers + PARAMS ((bfd *, bfd_boolean)); +static bfd_boolean som_finish_writing + PARAMS ((bfd *)); +static bfd_boolean som_build_and_write_symbol_table + PARAMS ((bfd *)); +static void som_prep_for_fixups + PARAMS ((bfd *, asymbol **, unsigned long)); +static bfd_boolean som_write_fixups + PARAMS ((bfd *, unsigned long, unsigned int *)); +static bfd_boolean som_write_space_strings + PARAMS ((bfd *, unsigned long, unsigned int *)); +static bfd_boolean som_write_symbol_strings + PARAMS ((bfd *, unsigned long, asymbol **, unsigned int, unsigned *, + COMPUNIT *)); +static bfd_boolean som_begin_writing + PARAMS ((bfd *)); static reloc_howto_type * som_bfd_reloc_type_lookup - PARAMS ((bfd *, bfd_reloc_code_real_type)); -static char som_section_type PARAMS ((const char *)); -static int som_decode_symclass PARAMS ((asymbol *)); -static boolean som_bfd_count_ar_symbols PARAMS ((bfd *, struct lst_header *, - symindex *)); - -static boolean som_bfd_fill_in_ar_symbols PARAMS ((bfd *, struct lst_header *, - carsym **syms)); -static boolean som_slurp_armap PARAMS ((bfd *)); -static boolean som_write_armap PARAMS ((bfd *, unsigned int, struct orl *, - unsigned int, int)); -static void som_bfd_derive_misc_symbol_info PARAMS ((bfd *, asymbol *, - struct som_misc_symbol_info *)); -static boolean som_bfd_prep_for_ar_write PARAMS ((bfd *, unsigned int *, - unsigned int *)); -static unsigned int som_bfd_ar_symbol_hash PARAMS ((asymbol *)); -static boolean som_bfd_ar_write_symbol_stuff PARAMS ((bfd *, unsigned int, - unsigned int, - struct lst_header, - unsigned int)); -static boolean som_is_space PARAMS ((asection *)); -static boolean som_is_subspace PARAMS ((asection *)); -static boolean som_is_container PARAMS ((asection *, asection *)); -static boolean som_bfd_free_cached_info PARAMS ((bfd *)); -static boolean som_bfd_link_split_section PARAMS ((bfd *, asection *)); + PARAMS ((bfd *, bfd_reloc_code_real_type)); +static char som_section_type + PARAMS ((const char *)); +static int som_decode_symclass + PARAMS ((asymbol *)); +static bfd_boolean som_bfd_count_ar_symbols + PARAMS ((bfd *, struct lst_header *, symindex *)); + +static bfd_boolean som_bfd_fill_in_ar_symbols + PARAMS ((bfd *, struct lst_header *, carsym **syms)); +static bfd_boolean som_slurp_armap + PARAMS ((bfd *)); +static bfd_boolean som_write_armap + PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int)); +static void som_bfd_derive_misc_symbol_info + PARAMS ((bfd *, asymbol *, struct som_misc_symbol_info *)); +static bfd_boolean som_bfd_prep_for_ar_write + PARAMS ((bfd *, unsigned int *, unsigned int *)); +static unsigned int som_bfd_ar_symbol_hash + PARAMS ((asymbol *)); +static bfd_boolean som_bfd_ar_write_symbol_stuff + PARAMS ((bfd *, unsigned int, unsigned int, struct lst_header, + unsigned int)); +static bfd_boolean som_is_space + PARAMS ((asection *)); +static bfd_boolean som_is_subspace + PARAMS ((asection *)); +static bfd_boolean som_is_container + PARAMS ((asection *, asection *)); +static bfd_boolean som_bfd_free_cached_info + PARAMS ((bfd *)); +static bfd_boolean som_bfd_link_split_section + PARAMS ((bfd *, asection *)); /* Map SOM section names to POSIX/BSD single-character symbol types. @@ -778,7 +805,7 @@ static const int comp3_opcodes[] = { #endif #define SOM_HOWTO(TYPE, NAME) \ - HOWTO(TYPE, 0, 0, 32, false, 0, 0, hppa_som_reloc, NAME, false, 0, 0, false) + HOWTO(TYPE, 0, 0, 32, FALSE, 0, 0, hppa_som_reloc, NAME, FALSE, 0, 0, FALSE) static reloc_howto_type som_hppa_howto_table[] = { SOM_HOWTO (R_NO_RELOCATION, "R_NO_RELOCATION"), @@ -1842,7 +1869,7 @@ som_object_setup (abfd, file_hdrp, aux_hdrp, current_offset) BFD sections which correspond to spaces will overlap the sections for the associated subspaces. */ -static boolean +static bfd_boolean setup_sections (abfd, file_hdr, current_offset) bfd *abfd; struct header *file_hdr; @@ -1931,7 +1958,7 @@ setup_sections (abfd, file_hdr, current_offset) goto error_return; /* Setup the start address and file loc from the first subspace - record. */ + record. */ space_asect->vma = subspace.subspace_start; space_asect->filepos = subspace.file_loc_init_value + current_offset; space_asect->alignment_power = log2 (subspace.alignment); @@ -2066,7 +2093,7 @@ setup_sections (abfd, file_hdr, current_offset) } /* This can happen for a .o which defines symbols in otherwise - empty subspaces. */ + empty subspaces. */ if (!save_subspace.file_loc_init_value) { space_asect->_cooked_size = 0; @@ -2114,7 +2141,7 @@ setup_sections (abfd, file_hdr, current_offset) if (subspace_sections != NULL) free (subspace_sections); - return true; + return TRUE; error_return: if (space_strings != NULL) @@ -2122,7 +2149,7 @@ setup_sections (abfd, file_hdr, current_offset) if (subspace_sections != NULL) free (subspace_sections); - return false; + return FALSE; } /* Read in a SOM object and make it into a BFD. */ @@ -2269,7 +2296,7 @@ som_object_p (abfd) /* Create a SOM object. */ -static boolean +static bfd_boolean som_mkobject (abfd) bfd *abfd; { @@ -2277,15 +2304,15 @@ som_mkobject (abfd) abfd->tdata.som_data = (struct som_data_struct *) bfd_zalloc (abfd, (bfd_size_type) sizeof (struct som_data_struct)); if (abfd->tdata.som_data == NULL) - return false; - return true; + return FALSE; + return TRUE; } /* Initialize some information in the file header. This routine makes not attempt at doing the right thing for a full executable; it is only meant to handle relocatable objects. */ -static boolean +static bfd_boolean som_prep_headers (abfd) bfd *abfd; { @@ -2296,7 +2323,7 @@ som_prep_headers (abfd) /* Make and attach a file header to the BFD. */ file_hdr = (struct header *) bfd_zalloc (abfd, amt); if (file_hdr == NULL) - return false; + return FALSE; obj_som_file_hdr (abfd) = file_hdr; if (abfd->flags & (EXEC_P | DYNAMIC)) @@ -2307,7 +2334,7 @@ som_prep_headers (abfd) obj_som_exec_hdr (abfd) = (struct som_exec_auxhdr *) bfd_zalloc (abfd, amt); if (obj_som_exec_hdr (abfd) == NULL) - return false; + return FALSE; if (abfd->flags & D_PAGED) file_hdr->a_magic = DEMAND_MAGIC; @@ -2351,7 +2378,7 @@ som_prep_headers (abfd) som_section_data (section)->space_dict = (struct space_dictionary_record *) bfd_zalloc (abfd, amt); if (som_section_data (section)->space_dict == NULL) - return false; + return FALSE; /* Set space attributes. Note most attributes of SOM spaces are set based on the subspaces it contains. */ som_section_data (section)->space_dict->loader_fix_index = -1; @@ -2374,7 +2401,7 @@ som_prep_headers (abfd) som_section_data (section)->subspace_dict = (struct subspace_dictionary_record *) bfd_zalloc (abfd, amt); if (som_section_data (section)->subspace_dict == NULL) - return false; + return FALSE; /* Set subspace attributes. Basic stuff is done here, additional attributes are filled in later as more information becomes @@ -2409,58 +2436,58 @@ som_prep_headers (abfd) som_section_data (section)->copy_data->quadrant; } } - return true; + return TRUE; } -/* Return true if the given section is a SOM space, false otherwise. */ +/* Return TRUE if the given section is a SOM space, FALSE otherwise. */ -static boolean +static bfd_boolean som_is_space (section) asection *section; { /* If no copy data is available, then it's neither a space nor a subspace. */ if (som_section_data (section)->copy_data == NULL) - return false; + return FALSE; /* If the containing space isn't the same as the given section, then this isn't a space. */ if (som_section_data (section)->copy_data->container != section && (som_section_data (section)->copy_data->container->output_section != section)) - return false; + return FALSE; /* OK. Must be a space. */ - return true; + return TRUE; } -/* Return true if the given section is a SOM subspace, false otherwise. */ +/* Return TRUE if the given section is a SOM subspace, FALSE otherwise. */ -static boolean +static bfd_boolean som_is_subspace (section) asection *section; { /* If no copy data is available, then it's neither a space nor a subspace. */ if (som_section_data (section)->copy_data == NULL) - return false; + return FALSE; /* If the containing space is the same as the given section, then this isn't a subspace. */ if (som_section_data (section)->copy_data->container == section || (som_section_data (section)->copy_data->container->output_section == section)) - return false; + return FALSE; /* OK. Must be a subspace. */ - return true; + return TRUE; } -/* Return true if the given space containins the given subspace. It +/* Return TRUE if the given space containins the given subspace. It is safe to assume space really is a space, and subspace really is a subspace. */ -static boolean +static bfd_boolean som_is_container (space, subspace) asection *space, *subspace; { @@ -2658,7 +2685,7 @@ som_prep_for_fixups (abfd, syms, num_syms) } } -static boolean +static bfd_boolean som_write_fixups (abfd, current_offset, total_reloc_sizep) bfd *abfd; unsigned long current_offset; @@ -2728,7 +2755,7 @@ som_write_fixups (abfd, current_offset, total_reloc_sizep) for this subspace in preparation for writing out its fixup stream. */ if (bfd_seek (abfd, current_offset + total_reloc_size, SEEK_SET) != 0) - return false; + return FALSE; /* Buffer space has already been allocated. Just perform some initialization here. */ @@ -2767,7 +2794,7 @@ som_write_fixups (abfd, current_offset, total_reloc_sizep) { amt = p - tmp_space; if (bfd_bwrite ((PTR) tmp_space, amt, abfd) != amt) - return false; + return FALSE; p = tmp_space; som_initialize_reloc_queue (reloc_queue); @@ -3028,14 +3055,14 @@ som_write_fixups (abfd, current_offset, total_reloc_sizep) /* Last BFD relocation for a subspace has been processed. Map the rest of the subspace with R_NO_RELOCATION fixups. */ - p = som_reloc_skip (abfd, bfd_section_size (abfd, subsection) - - reloc_offset, + p = som_reloc_skip (abfd, (bfd_section_size (abfd, subsection) + - reloc_offset), p, &subspace_reloc_size, reloc_queue); /* Scribble out the relocations. */ amt = p - tmp_space; if (bfd_bwrite ((PTR) tmp_space, amt, abfd) != amt) - return false; + return FALSE; p = tmp_space; total_reloc_size += subspace_reloc_size; @@ -3045,12 +3072,12 @@ som_write_fixups (abfd, current_offset, total_reloc_sizep) section = section->next; } *total_reloc_sizep = total_reloc_size; - return true; + return TRUE; } /* Write out the space/subspace string table. */ -static boolean +static bfd_boolean som_write_space_strings (abfd, current_offset, string_sizep) bfd *abfd; unsigned long current_offset; @@ -3068,7 +3095,7 @@ som_write_space_strings (abfd, current_offset, string_sizep) /* Seek to the start of the space strings in preparation for writing them out. */ if (bfd_seek (abfd, (file_ptr) current_offset, SEEK_SET) != 0) - return false; + return FALSE; /* Walk through all the spaces and subspaces (order is not important) building up and writing string table entries for their names. */ @@ -3085,27 +3112,27 @@ som_write_space_strings (abfd, current_offset, string_sizep) length = strlen (section->name); /* If there is not enough room for the next entry, then dump the - current buffer contents now and maybe allocate a larger - buffer. Each entry will take 4 bytes to hold the string - length + the string itself + null terminator. */ + current buffer contents now and maybe allocate a larger + buffer. Each entry will take 4 bytes to hold the string + length + the string itself + null terminator. */ if (p - tmp_space + 5 + length > tmp_space_size) { /* Flush buffer before refilling or reallocating. */ amt = p - tmp_space; if (bfd_bwrite ((PTR) &tmp_space[0], amt, abfd) != amt) - return false; + return FALSE; /* Reallocate if now empty buffer still too small. */ if (5 + length > tmp_space_size) { /* Ensure a minimum growth factor to avoid O(n**2) space - consumption for n strings. The optimal minimum - factor seems to be 2, as no other value can guarantee - wasting less than 50% space. (Note that we cannot - deallocate space allocated by `alloca' without - returning from this function.) The same technique is - used a few more times below when a buffer is - reallocated. */ + consumption for n strings. The optimal minimum + factor seems to be 2, as no other value can guarantee + wasting less than 50% space. (Note that we cannot + deallocate space allocated by `alloca' without + returning from this function.) The same technique is + used a few more times below when a buffer is + reallocated. */ tmp_space_size = MAX (2 * tmp_space_size, 5 + length); tmp_space = alloca (tmp_space_size); } @@ -3144,14 +3171,14 @@ som_write_space_strings (abfd, current_offset, string_sizep) contained in a partial block. */ amt = p - tmp_space; if (bfd_bwrite ((PTR) &tmp_space[0], amt, abfd) != amt) - return false; + return FALSE; *string_sizep = strings_size; - return true; + return TRUE; } /* Write out the symbol string table. */ -static boolean +static bfd_boolean som_write_symbol_strings (abfd, current_offset, syms, num_syms, string_sizep, compilation_unit) bfd *abfd; @@ -3190,7 +3217,7 @@ som_write_symbol_strings (abfd, current_offset, syms, num_syms, string_sizep, /* Seek to the start of the space strings in preparation for writing them out. */ if (bfd_seek (abfd, (file_ptr) current_offset, SEEK_SET) != 0) - return false; + return FALSE; if (compilation_unit) { @@ -3206,7 +3233,7 @@ som_write_symbol_strings (abfd, current_offset, syms, num_syms, string_sizep, /* Flush buffer before refilling or reallocating. */ amt = p - tmp_space; if (bfd_bwrite ((PTR) &tmp_space[0], amt, abfd) != amt) - return false; + return FALSE; /* Reallocate if now empty buffer still too small. */ if (5 + length > tmp_space_size) @@ -3217,7 +3244,7 @@ som_write_symbol_strings (abfd, current_offset, syms, num_syms, string_sizep, } /* Reset to beginning of the (possibly new) buffer - space. */ + space. */ p = tmp_space; } @@ -3275,7 +3302,7 @@ som_write_symbol_strings (abfd, current_offset, syms, num_syms, string_sizep, /* Flush buffer before refilling or reallocating. */ amt = p - tmp_space; if (bfd_bwrite ((PTR) &tmp_space[0], amt, abfd) != amt) - return false; + return FALSE; /* Reallocate if now empty buffer still too small. */ if (5 + length > tmp_space_size) @@ -3316,17 +3343,17 @@ som_write_symbol_strings (abfd, current_offset, syms, num_syms, string_sizep, /* Scribble out any partial block. */ amt = p - tmp_space; if (bfd_bwrite ((PTR) &tmp_space[0], amt, abfd) != amt) - return false; + return FALSE; *string_sizep = strings_size; - return true; + return TRUE; } /* Compute variable information to be placed in the SOM headers, space/subspace dictionaries, relocation streams, etc. Begin writing parts of the object file. */ -static boolean +static bfd_boolean som_begin_writing (abfd) bfd *abfd; { @@ -3372,14 +3399,14 @@ som_begin_writing (abfd) bfd_size_type len; if (bfd_seek (abfd, (file_ptr) current_offset, SEEK_SET) != 0) - return false; + return FALSE; /* Write the aux_id structure and the string length. */ len = sizeof (struct aux_id) + sizeof (unsigned int); obj_som_file_hdr (abfd)->aux_header_size += len; current_offset += len; if (bfd_bwrite ((PTR) obj_som_version_hdr (abfd), len, abfd) != len) - return false; + return FALSE; /* Write the version string. */ len = obj_som_version_hdr (abfd)->header_id.length - sizeof (int); @@ -3387,7 +3414,7 @@ som_begin_writing (abfd) current_offset += len; if (bfd_bwrite ((PTR) obj_som_version_hdr (abfd)->user_string, len, abfd) != len) - return false; + return FALSE; } if (obj_som_copyright_hdr (abfd) != NULL) @@ -3395,14 +3422,14 @@ som_begin_writing (abfd) bfd_size_type len; if (bfd_seek (abfd, (file_ptr) current_offset, SEEK_SET) != 0) - return false; + return FALSE; /* Write the aux_id structure and the string length. */ len = sizeof (struct aux_id) + sizeof (unsigned int); obj_som_file_hdr (abfd)->aux_header_size += len; current_offset += len; if (bfd_bwrite ((PTR) obj_som_copyright_hdr (abfd), len, abfd) != len) - return false; + return FALSE; /* Write the copyright string. */ len = obj_som_copyright_hdr (abfd)->header_id.length - sizeof (int); @@ -3410,7 +3437,7 @@ som_begin_writing (abfd) current_offset += len; if (bfd_bwrite ((PTR) obj_som_copyright_hdr (abfd)->copyright, len, abfd) != len) - return false; + return FALSE; } /* Next comes the initialization pointers; we have no initialization @@ -3458,7 +3485,7 @@ som_begin_writing (abfd) /* Scribble out the space strings. */ if (! som_write_space_strings (abfd, current_offset, &strings_size)) - return false; + return FALSE; /* Record total string table size in the header and update the current offset. */ @@ -3655,9 +3682,9 @@ som_begin_writing (abfd) if (abfd->flags & (EXEC_P | DYNAMIC)) current_offset = SOM_ALIGN (current_offset, PA_PAGESIZE); if (bfd_seek (abfd, (file_ptr) current_offset - 1, SEEK_SET) != 0) - return false; + return FALSE; if (bfd_bwrite ((PTR) "", (bfd_size_type) 1, abfd) != 1) - return false; + return FALSE; obj_som_file_hdr (abfd)->unloadable_sp_size = current_offset - obj_som_file_hdr (abfd)->unloadable_sp_location; @@ -3669,12 +3696,12 @@ som_begin_writing (abfd) /* Done. Store the total size of the SOM so far. */ obj_som_file_hdr (abfd)->som_length = current_offset; - return true; + return TRUE; } /* Finally, scribble out the various headers to the disk. */ -static boolean +static bfd_boolean som_finish_writing (abfd) bfd *abfd; { @@ -3730,7 +3757,7 @@ som_finish_writing (abfd) if (! som_write_symbol_strings (abfd, current_offset, syms, num_syms, &strings_size, obj_som_compilation_unit (abfd))) - return false; + return FALSE; /* Record total string table size in header and update the current offset. */ @@ -3751,7 +3778,7 @@ som_finish_writing (abfd) /* Write the fixups and update fields in subspace headers which relate to the fixup stream. */ if (! som_write_fixups (abfd, current_offset, &total_reloc_size)) - return false; + return FALSE; /* Record the total size of the fixup stream in the file header. */ obj_som_file_hdr (abfd)->fixup_request_total = total_reloc_size; @@ -3762,7 +3789,7 @@ som_finish_writing (abfd) /* Now that the symbol table information is complete, build and write the symbol table. */ if (! som_build_and_write_symbol_table (abfd)) - return false; + return FALSE; /* Subspaces are written first so that we can set up information about them in their containing spaces as the subspace is written. */ @@ -3770,7 +3797,7 @@ som_finish_writing (abfd) /* Seek to the start of the subspace dictionary records. */ location = obj_som_file_hdr (abfd)->subspace_location; if (bfd_seek (abfd, location, SEEK_SET) != 0) - return false; + return FALSE; section = abfd->sections; /* Now for each loadable space write out records for its subspaces. */ @@ -3820,7 +3847,7 @@ som_finish_writing (abfd) amt = sizeof (struct subspace_dictionary_record); if (bfd_bwrite ((PTR) som_section_data (subsection)->subspace_dict, amt, abfd) != amt) - return false; + return FALSE; } /* Goto the next section. */ section = section->next; @@ -3876,7 +3903,7 @@ som_finish_writing (abfd) amt = sizeof (struct subspace_dictionary_record); if (bfd_bwrite ((PTR) som_section_data (subsection)->subspace_dict, amt, abfd) != amt) - return false; + return FALSE; } /* Goto the next section. */ section = section->next; @@ -3889,7 +3916,7 @@ som_finish_writing (abfd) dictionary records. */ location = obj_som_file_hdr (abfd)->space_location; if (bfd_seek (abfd, location, SEEK_SET) != 0) - return false; + return FALSE; section = abfd->sections; for (i = 0; i < num_spaces; i++) @@ -3902,7 +3929,7 @@ som_finish_writing (abfd) amt = sizeof (struct space_dictionary_record); if (bfd_bwrite ((PTR) som_section_data (section)->space_dict, amt, abfd) != amt) - return false; + return FALSE; /* Goto the next section. */ section = section->next; @@ -3913,11 +3940,11 @@ som_finish_writing (abfd) { location = obj_som_file_hdr (abfd)->compiler_location; if (bfd_seek (abfd, location, SEEK_SET) != 0) - return false; + return FALSE; amt = COMPUNITSZ; if (bfd_bwrite ((PTR) obj_som_compilation_unit (abfd), amt, abfd) != amt) - return false; + return FALSE; } /* Setting of the system_id has to happen very late now that copying of @@ -3938,10 +3965,10 @@ som_finish_writing (abfd) /* Only thing left to do is write out the file header. It is always at location zero. Seek there and write it. */ if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0) - return false; + return FALSE; amt = sizeof (struct header); if (bfd_bwrite ((PTR) obj_som_file_hdr (abfd), amt, abfd) != amt) - return false; + return FALSE; /* Now write the exec header. */ if (abfd->flags & (EXEC_P | DYNAMIC)) @@ -3970,18 +3997,18 @@ som_finish_writing (abfd) || exec_header->exec_dfile + exec_header->exec_dsize > som_length) { bfd_set_error (bfd_error_bad_value); - return false; + return FALSE; } if (bfd_seek (abfd, obj_som_file_hdr (abfd)->aux_header_location, SEEK_SET) != 0) - return false; + return FALSE; amt = AUX_HDR_SIZE; if (bfd_bwrite ((PTR) exec_header, amt, abfd) != amt) - return false; + return FALSE; } - return true; + return TRUE; } /* Compute and return the checksum for a SOM file header. */ @@ -4116,16 +4143,16 @@ som_bfd_derive_misc_symbol_info (abfd, sym, info) /* The secondary_def field is for weak symbols. */ if (sym->flags & BSF_WEAK) - info->secondary_def = true; + info->secondary_def = TRUE; else - info->secondary_def = false; + info->secondary_def = FALSE; } /* Build and write, in one big chunk, the entire symbol table for this BFD. */ -static boolean +static bfd_boolean som_build_and_write_symbol_table (abfd) bfd *abfd; { @@ -4170,23 +4197,23 @@ som_build_and_write_symbol_table (abfd) /* Everything is ready, seek to the right location and scribble out the symbol table. */ if (bfd_seek (abfd, symtab_location, SEEK_SET) != 0) - return false; + return FALSE; if (bfd_bwrite ((PTR) som_symtab, symtab_size, abfd) != symtab_size) goto error_return; if (som_symtab != NULL) free (som_symtab); - return true; + return TRUE; error_return: if (som_symtab != NULL) free (som_symtab); - return false; + return FALSE; } /* Write an object in SOM format. */ -static boolean +static bfd_boolean som_write_object_contents (abfd) bfd *abfd; { @@ -4195,7 +4222,7 @@ som_write_object_contents (abfd) /* Set up fixed parts of the file, space, and subspace headers. Notify the world that output has begun. */ som_prep_headers (abfd); - abfd->output_has_begun = true; + abfd->output_has_begun = TRUE; /* Start writing the object file. This include all the string tables, fixup streams, and other portions of the object file. */ som_begin_writing (abfd); @@ -4206,7 +4233,7 @@ som_write_object_contents (abfd) /* Read and save the string table associated with the given BFD. */ -static boolean +static bfd_boolean som_slurp_string_table (abfd) bfd *abfd; { @@ -4215,7 +4242,7 @@ som_slurp_string_table (abfd) /* Use the saved version if its available. */ if (obj_som_stringtab (abfd) != NULL) - return true; + return TRUE; /* I don't think this can currently happen, and I'm not sure it should really be an error, but it's better than getting unpredictable results @@ -4223,24 +4250,24 @@ som_slurp_string_table (abfd) if (obj_som_stringtab_size (abfd) == 0) { bfd_set_error (bfd_error_no_symbols); - return false; + return FALSE; } /* Allocate and read in the string table. */ amt = obj_som_stringtab_size (abfd); stringtab = bfd_zmalloc (amt); if (stringtab == NULL) - return false; + return FALSE; if (bfd_seek (abfd, obj_som_str_filepos (abfd), SEEK_SET) != 0) - return false; + return FALSE; if (bfd_bread (stringtab, amt, abfd) != amt) - return false; + return FALSE; /* Save our results and return success. */ obj_som_stringtab (abfd) = stringtab; - return true; + return TRUE; } /* Return the amount of data (in bytes) required to hold the symbol @@ -4471,7 +4498,7 @@ som_slurp_symbol_table (abfd) sym->symbol.flags |= BSF_DEBUGGING; /* Note increment at bottom of loop, since we skip some symbols - we can not include it as part of the for statement. */ + we can not include it as part of the for statement. */ sym++; } @@ -4484,12 +4511,12 @@ som_slurp_symbol_table (abfd) successful_return: if (buf != NULL) free (buf); - return (true); + return (TRUE); error_return: if (buf != NULL) free (buf); - return false; + return FALSE; } /* Canonicalize a SOM symbol table. Return the number of entries @@ -4563,7 +4590,7 @@ som_print_symbol (abfd, afile, symbol, how) } } -static boolean +static bfd_boolean som_bfd_is_local_label_name (abfd, name) bfd *abfd ATTRIBUTE_UNUSED; const char *name; @@ -4591,7 +4618,7 @@ som_set_reloc_info (fixup, end, internal_relocs, section, symbols, just_count) arelent *internal_relocs; asection *section; asymbol **symbols; - boolean just_count; + bfd_boolean just_count; { unsigned int op, varname, deallocate_contents = 0; unsigned char *end_fixups = &fixup[end]; @@ -4881,7 +4908,7 @@ som_set_reloc_info (fixup, end, internal_relocs, section, symbols, just_count) if (rptr->addend == 0 && !section->contents) { /* Got to read the damn contents first. We don't - bother saving the contents (yet). Add it one + bother saving the contents (yet). Add it one day if the need arises. */ section->contents = bfd_malloc (section->_raw_size); if (section->contents == NULL) @@ -4925,15 +4952,15 @@ som_set_reloc_info (fixup, end, internal_relocs, section, symbols, just_count) /* Read in the relocs (aka fixups in SOM terms) for a section. som_get_reloc_upper_bound calls this routine with JUST_COUNT - set to true to indicate it only needs a count of the number + set to TRUE to indicate it only needs a count of the number of actual relocations. */ -static boolean +static bfd_boolean som_slurp_reloc_table (abfd, section, symbols, just_count) bfd *abfd; asection *section; asymbol **symbols; - boolean just_count; + bfd_boolean just_count; { char *external_relocs; unsigned int fixup_stream_size; @@ -4944,7 +4971,7 @@ som_slurp_reloc_table (abfd, section, symbols, just_count) fixup_stream_size = som_section_data (section)->reloc_size; /* If there were no relocations, then there is nothing to do. */ if (section->reloc_count == 0) - return true; + return TRUE; /* If reloc_count is -1, then the relocation stream has not been parsed. We must do so now to know how many relocations exist. */ @@ -4953,45 +4980,45 @@ som_slurp_reloc_table (abfd, section, symbols, just_count) amt = fixup_stream_size; external_relocs = (char *) bfd_malloc (amt); if (external_relocs == (char *) NULL) - return false; + return FALSE; /* Read in the external forms. */ if (bfd_seek (abfd, obj_som_reloc_filepos (abfd) + section->rel_filepos, SEEK_SET) != 0) - return false; + return FALSE; if (bfd_bread (external_relocs, amt, abfd) != amt) - return false; + return FALSE; /* Let callers know how many relocations found. also save the relocation stream as we will need it again. */ section->reloc_count = som_set_reloc_info (external_relocs, fixup_stream_size, - NULL, NULL, NULL, true); + NULL, NULL, NULL, TRUE); som_section_data (section)->reloc_stream = external_relocs; } /* If the caller only wanted a count, then return now. */ if (just_count) - return true; + return TRUE; num_relocs = section->reloc_count; external_relocs = som_section_data (section)->reloc_stream; /* Return saved information about the relocations if it is available. */ if (section->relocation != (arelent *) NULL) - return true; + return TRUE; amt = num_relocs; amt *= sizeof (arelent); internal_relocs = (arelent *) bfd_zalloc (abfd, (amt)); if (internal_relocs == (arelent *) NULL) - return false; + return FALSE; /* Process and internalize the relocations. */ som_set_reloc_info (external_relocs, fixup_stream_size, - internal_relocs, section, symbols, false); + internal_relocs, section, symbols, FALSE); /* We're done with the external relocations. Free them. */ free (external_relocs); @@ -4999,7 +5026,7 @@ som_slurp_reloc_table (abfd, section, symbols, just_count) /* Save our results and return success. */ section->relocation = internal_relocs; - return (true); + return TRUE; } /* Return the number of bytes required to store the relocation @@ -5014,7 +5041,7 @@ som_get_reloc_upper_bound (abfd, asect) and parse it to determine how many relocations exist. */ if (asect->flags & SEC_RELOC) { - if (! som_slurp_reloc_table (abfd, asect, NULL, true)) + if (! som_slurp_reloc_table (abfd, asect, NULL, TRUE)) return -1; return (asect->reloc_count + 1) * sizeof (arelent *); } @@ -5035,7 +5062,7 @@ som_canonicalize_reloc (abfd, section, relptr, symbols) arelent *tblptr; int count; - if (! som_slurp_reloc_table (abfd, section, symbols, false)) + if (! som_slurp_reloc_table (abfd, section, symbols, FALSE)) return -1; count = section->reloc_count; @@ -5052,7 +5079,7 @@ extern const bfd_target som_vec; /* A hook to set up object file dependent section information. */ -static boolean +static bfd_boolean som_new_section_hook (abfd, newsect) bfd *abfd; asection *newsect; @@ -5060,17 +5087,17 @@ som_new_section_hook (abfd, newsect) bfd_size_type amt = sizeof (struct som_section_data_struct); newsect->used_by_bfd = (PTR) bfd_zalloc (abfd, amt); if (!newsect->used_by_bfd) - return false; + return FALSE; newsect->alignment_power = 3; /* We allow more than three sections internally. */ - return true; + return TRUE; } /* Copy any private info we understand from the input symbol to the output symbol. */ -static boolean +static bfd_boolean som_bfd_copy_private_symbol_data (ibfd, isymbol, obfd, osymbol) bfd *ibfd; asymbol *isymbol; @@ -5083,20 +5110,20 @@ som_bfd_copy_private_symbol_data (ibfd, isymbol, obfd, osymbol) /* One day we may try to grok other private data. */ if (ibfd->xvec->flavour != bfd_target_som_flavour || obfd->xvec->flavour != bfd_target_som_flavour) - return false; + return FALSE; /* The only private information we need to copy is the argument relocation bits. */ output_symbol->tc_data.ap.hppa_arg_reloc = input_symbol->tc_data.ap.hppa_arg_reloc; - return true; + return TRUE; } /* Copy any private info we understand from the input section to the output section. */ -static boolean +static bfd_boolean som_bfd_copy_private_section_data (ibfd, isection, obfd, osection) bfd *ibfd; asection *isection; @@ -5109,13 +5136,13 @@ som_bfd_copy_private_section_data (ibfd, isection, obfd, osection) if (ibfd->xvec->flavour != bfd_target_som_flavour || obfd->xvec->flavour != bfd_target_som_flavour || (!som_is_space (isection) && !som_is_subspace (isection))) - return true; + return TRUE; amt = sizeof (struct som_copyable_section_data_struct); som_section_data (osection)->copy_data = (struct som_copyable_section_data_struct *) bfd_zalloc (obfd, amt); if (som_section_data (osection)->copy_data == NULL) - return false; + return FALSE; memcpy (som_section_data (osection)->copy_data, som_section_data (isection)->copy_data, @@ -5126,38 +5153,38 @@ som_bfd_copy_private_section_data (ibfd, isection, obfd, osection) som_section_data (osection)->copy_data->container = som_section_data (osection)->copy_data->container->output_section; - return true; + return TRUE; } /* Copy any private info we understand from the input bfd to the output bfd. */ -static boolean +static bfd_boolean som_bfd_copy_private_bfd_data (ibfd, obfd) bfd *ibfd, *obfd; { /* One day we may try to grok other private data. */ if (ibfd->xvec->flavour != bfd_target_som_flavour || obfd->xvec->flavour != bfd_target_som_flavour) - return true; + return TRUE; /* Allocate some memory to hold the data we need. */ obj_som_exec_data (obfd) = (struct som_exec_data *) bfd_zalloc (obfd, (bfd_size_type) sizeof (struct som_exec_data)); if (obj_som_exec_data (obfd) == NULL) - return false; + return FALSE; /* Now copy the data. */ memcpy (obj_som_exec_data (obfd), obj_som_exec_data (ibfd), sizeof (struct som_exec_data)); - return true; + return TRUE; } /* Set backend info for sections which can not be described in the BFD data structures. */ -boolean +bfd_boolean bfd_som_set_section_attributes (section, defined, private, sort_key, spnum) asection *section; int defined; @@ -5173,20 +5200,20 @@ bfd_som_set_section_attributes (section, defined, private, sort_key, spnum) (struct som_copyable_section_data_struct *) bfd_zalloc (section->owner, amt); if (som_section_data (section)->copy_data == NULL) - return false; + return FALSE; } som_section_data (section)->copy_data->sort_key = sort_key; som_section_data (section)->copy_data->is_defined = defined; som_section_data (section)->copy_data->is_private = private; som_section_data (section)->copy_data->container = section; som_section_data (section)->copy_data->space_number = spnum; - return true; + return TRUE; } /* Set backend info for subsections which can not be described in the BFD data structures. */ -boolean +bfd_boolean bfd_som_set_subsection_attributes (section, container, access, sort_key, quadrant) asection *section; @@ -5203,13 +5230,13 @@ bfd_som_set_subsection_attributes (section, container, access, (struct som_copyable_section_data_struct *) bfd_zalloc (section->owner, amt); if (som_section_data (section)->copy_data == NULL) - return false; + return FALSE; } som_section_data (section)->copy_data->sort_key = sort_key; som_section_data (section)->copy_data->access_control_bits = access; som_section_data (section)->copy_data->quadrant = quadrant; som_section_data (section)->copy_data->container = container; - return true; + return TRUE; } /* Set the full SOM symbol type. SOM needs far more symbol information @@ -5229,7 +5256,7 @@ bfd_som_set_symbol_type (symbol, type) /* Attach an auxiliary header to the BFD backend so that it may be written into the object file. */ -boolean +bfd_boolean bfd_som_attach_aux_hdr (abfd, type, string) bfd *abfd; int type; @@ -5248,7 +5275,7 @@ bfd_som_attach_aux_hdr (abfd, type, string) obj_som_version_hdr (abfd) = (struct user_string_aux_hdr *) bfd_zalloc (abfd, amt); if (!obj_som_version_hdr (abfd)) - return false; + return FALSE; obj_som_version_hdr (abfd)->header_id.type = VERSION_AUX_ID; obj_som_version_hdr (abfd)->header_id.length = len + pad; obj_som_version_hdr (abfd)->header_id.length += sizeof (int); @@ -5266,20 +5293,20 @@ bfd_som_attach_aux_hdr (abfd, type, string) obj_som_copyright_hdr (abfd) = (struct copyright_aux_hdr *) bfd_zalloc (abfd, amt); if (!obj_som_copyright_hdr (abfd)) - return false; + return FALSE; obj_som_copyright_hdr (abfd)->header_id.type = COPYRIGHT_AUX_ID; obj_som_copyright_hdr (abfd)->header_id.length = len + pad; obj_som_copyright_hdr (abfd)->header_id.length += sizeof (int); obj_som_copyright_hdr (abfd)->string_length = len; strcpy (obj_som_copyright_hdr (abfd)->copyright, string); } - return true; + return TRUE; } /* Attach an compilation unit header to the BFD backend so that it may be written into the object file. */ -boolean +bfd_boolean bfd_som_attach_compilation_unit (abfd, name, language_name, product_id, version_id) bfd *abfd; @@ -5290,14 +5317,14 @@ bfd_som_attach_compilation_unit (abfd, name, language_name, product_id, { COMPUNIT *n = (COMPUNIT *) bfd_zalloc (abfd, (bfd_size_type) COMPUNITSZ); if (n == NULL) - return false; + return FALSE; #define STRDUP(f) \ if (f != NULL) \ { \ n->f.n_name = bfd_alloc (abfd, (bfd_size_type) strlen (f) + 1); \ if (n->f.n_name == NULL) \ - return false; \ + return FALSE; \ strcpy (n->f.n_name, f); \ } @@ -5310,10 +5337,10 @@ bfd_som_attach_compilation_unit (abfd, name, language_name, product_id, obj_som_compilation_unit (abfd) = n; - return true; + return TRUE; } -static boolean +static bfd_boolean som_get_section_contents (abfd, section, location, offset, count) bfd *abfd; sec_ptr section; @@ -5322,15 +5349,15 @@ som_get_section_contents (abfd, section, location, offset, count) bfd_size_type count; { if (count == 0 || ((section->flags & SEC_HAS_CONTENTS) == 0)) - return true; + return TRUE; if ((bfd_size_type) (offset+count) > section->_raw_size || bfd_seek (abfd, (file_ptr) (section->filepos + offset), SEEK_SET) != 0 || bfd_bread (location, count, abfd) != count) - return (false); /* on error */ - return (true); + return FALSE; /* on error */ + return TRUE; } -static boolean +static bfd_boolean som_set_section_contents (abfd, section, location, offset, count) bfd *abfd; sec_ptr section; @@ -5343,7 +5370,7 @@ som_set_section_contents (abfd, section, location, offset, count) /* Set up fixed parts of the file, space, and subspace headers. Notify the world that output has begun. */ som_prep_headers (abfd); - abfd->output_has_begun = true; + abfd->output_has_begun = TRUE; /* Start writing the object file. This include all the string tables, fixup streams, and other portions of the object file. */ som_begin_writing (abfd); @@ -5353,20 +5380,20 @@ som_set_section_contents (abfd, section, location, offset, count) are not generated at run time by the OS). */ if (!som_is_subspace (section) || ((section->flags & SEC_HAS_CONTENTS) == 0)) - return true; + return TRUE; /* Seek to the proper offset within the object file and write the data. */ offset += som_section_data (section)->subspace_dict->file_loc_init_value; if (bfd_seek (abfd, offset, SEEK_SET) != 0) - return false; + return FALSE; if (bfd_bwrite ((PTR) location, count, abfd) != count) - return false; - return true; + return FALSE; + return TRUE; } -static boolean +static bfd_boolean som_set_arch_mach (abfd, arch, machine) bfd *abfd; enum bfd_architecture arch; @@ -5376,7 +5403,7 @@ som_set_arch_mach (abfd, arch, machine) return bfd_default_set_arch_mach (abfd, arch, machine); } -static boolean +static bfd_boolean som_find_nearest_line (abfd, section, symbols, offset, filename_ptr, functionname_ptr, line_ptr) bfd *abfd ATTRIBUTE_UNUSED; @@ -5387,18 +5414,18 @@ som_find_nearest_line (abfd, section, symbols, offset, filename_ptr, const char **functionname_ptr ATTRIBUTE_UNUSED; unsigned int *line_ptr ATTRIBUTE_UNUSED; { - return (false); + return FALSE; } static int som_sizeof_headers (abfd, reloc) bfd *abfd ATTRIBUTE_UNUSED; - boolean reloc ATTRIBUTE_UNUSED; + bfd_boolean reloc ATTRIBUTE_UNUSED; { (*_bfd_error_handler) (_("som_sizeof_headers unimplemented")); fflush (stderr); abort (); - return (0); + return 0; } /* Return the single-character symbol type corresponding to @@ -5465,7 +5492,7 @@ som_get_symbol_info (ignore_abfd, symbol, ret) /* Count the number of symbols in the archive symbol table. Necessary so that we can allocate space for all the carsyms at once. */ -static boolean +static bfd_boolean som_bfd_count_ar_symbols (abfd, lst_header, count) bfd *abfd; struct lst_header *lst_header; @@ -5530,18 +5557,18 @@ som_bfd_count_ar_symbols (abfd, lst_header, count) } if (hash_table != NULL) free (hash_table); - return true; + return TRUE; error_return: if (hash_table != NULL) free (hash_table); - return false; + return FALSE; } /* Fill in the canonical archive symbols (SYMS) from the archive described by ABFD and LST_HEADER. */ -static boolean +static bfd_boolean som_bfd_fill_in_ar_symbols (abfd, lst_header, syms) bfd *abfd; struct lst_header *lst_header; @@ -5671,19 +5698,19 @@ som_bfd_fill_in_ar_symbols (abfd, lst_header, syms) free (hash_table); if (som_dict != NULL) free (som_dict); - return true; + return TRUE; error_return: if (hash_table != NULL) free (hash_table); if (som_dict != NULL) free (som_dict); - return false; + return FALSE; } /* Read in the LST from the archive. */ -static boolean +static bfd_boolean som_slurp_armap (abfd) bfd *abfd; { @@ -5697,29 +5724,29 @@ som_slurp_armap (abfd) /* Special cases. */ if (i == 0) - return true; + return TRUE; if (i != 16) - return false; + return FALSE; if (bfd_seek (abfd, (file_ptr) -16, SEEK_CUR) != 0) - return false; + return FALSE; /* For archives without .o files there is no symbol table. */ if (strncmp (nextname, "/ ", 16)) { - bfd_has_map (abfd) = false; - return true; + bfd_has_map (abfd) = FALSE; + return TRUE; } /* Read in and sanity check the archive header. */ amt = sizeof (struct ar_hdr); if (bfd_bread ((PTR) &ar_header, amt, abfd) != amt) - return false; + return FALSE; if (strncmp (ar_header.ar_fmag, ARFMAG, 2)) { bfd_set_error (bfd_error_malformed_archive); - return false; + return FALSE; } /* How big is the archive symbol table entry? */ @@ -5728,7 +5755,7 @@ som_slurp_armap (abfd) if (errno != 0) { bfd_set_error (bfd_error_malformed_archive); - return false; + return FALSE; } /* Save off the file offset of the first real user data. */ @@ -5738,23 +5765,23 @@ som_slurp_armap (abfd) in just a minute. */ amt = sizeof (struct lst_header); if (bfd_bread ((PTR) &lst_header, amt, abfd) != amt) - return false; + return FALSE; /* Sanity check. */ if (lst_header.a_magic != LIBMAGIC) { bfd_set_error (bfd_error_malformed_archive); - return false; + return FALSE; } /* Count the number of symbols in the library symbol table. */ if (! som_bfd_count_ar_symbols (abfd, &lst_header, &ardata->symdef_count)) - return false; + return FALSE; /* Get back to the start of the library symbol table. */ if (bfd_seek (abfd, (ardata->first_file_filepos - parsed_size + sizeof (struct lst_header)), SEEK_SET) != 0) - return false; + return FALSE; /* Initializae the cache and allocate space for the library symbols. */ ardata->cache = 0; @@ -5762,20 +5789,20 @@ som_slurp_armap (abfd) amt *= sizeof (carsym); ardata->symdefs = (carsym *) bfd_alloc (abfd, amt); if (!ardata->symdefs) - return false; + return FALSE; /* Now fill in the canonical archive symbols. */ if (! som_bfd_fill_in_ar_symbols (abfd, &lst_header, &ardata->symdefs)) - return false; + return FALSE; /* Seek back to the "first" file in the archive. Note the "first" file may be the extended name table. */ if (bfd_seek (abfd, ardata->first_file_filepos, SEEK_SET) != 0) - return false; + return FALSE; /* Notify the generic archive code that we have a symbol map. */ - bfd_has_map (abfd) = true; - return true; + bfd_has_map (abfd) = TRUE; + return TRUE; } /* Begin preparing to write a SOM library symbol table. @@ -5783,7 +5810,7 @@ som_slurp_armap (abfd) As part of the prep work we need to determine the number of symbols and the size of the associated string section. */ -static boolean +static bfd_boolean som_bfd_prep_for_ar_write (abfd, num_syms, stringsize) bfd *abfd; unsigned int *num_syms, *stringsize; @@ -5812,7 +5839,7 @@ som_bfd_prep_for_ar_write (abfd, num_syms, stringsize) to it. It's a little slimey to grab the symbols via obj_som_symtab, but doing so avoids allocating lots of extra memory. */ if (! som_slurp_symbol_table (curr_bfd)) - return false; + return FALSE; sym = obj_som_symtab (curr_bfd); curr_count = bfd_get_symcount (curr_bfd); @@ -5851,7 +5878,7 @@ som_bfd_prep_for_ar_write (abfd, num_syms, stringsize) curr_bfd = curr_bfd->next; } - return true; + return TRUE; } /* Hash a symbol name based on the hashing algorithm presented in the @@ -5874,7 +5901,7 @@ som_bfd_ar_symbol_hash (symbol) /* Do the bulk of the work required to write the SOM library symbol table. */ -static boolean +static bfd_boolean som_bfd_ar_write_symbol_stuff (abfd, nsyms, string_size, lst, elength) bfd *abfd; unsigned int nsyms, string_size; @@ -6111,7 +6138,7 @@ som_bfd_ar_write_symbol_stuff (abfd, nsyms, string_size, lst, elength) free (lst_syms); if (strings != NULL) free (strings); - return true; + return TRUE; error_return: if (hash_table != NULL) @@ -6125,14 +6152,14 @@ som_bfd_ar_write_symbol_stuff (abfd, nsyms, string_size, lst, elength) if (strings != NULL) free (strings); - return false; + return FALSE; } /* Write out the LST for the archive. You'll never believe this is really how armaps are handled in SOM... */ -static boolean +static bfd_boolean som_write_armap (abfd, elength, map, orl_count, stridx) bfd *abfd; unsigned int elength; @@ -6152,7 +6179,7 @@ som_write_armap (abfd, elength, map, orl_count, stridx) if (stat (abfd->filename, &statbuf) != 0) { bfd_set_error (bfd_error_system_call); - return false; + return FALSE; } /* Fudge factor. */ bfd_ardata (abfd)->armap_timestamp = statbuf.st_mtime + 60; @@ -6203,7 +6230,7 @@ som_write_armap (abfd, elength, map, orl_count, stridx) /* Count how many symbols we will have on the hash chains and the size of the associated string table. */ if (! som_bfd_prep_for_ar_write (abfd, &nsyms, &stringsize)) - return false; + return FALSE; lst_size += sizeof (struct lst_symbol_record) * nsyms; @@ -6241,32 +6268,32 @@ som_write_armap (abfd, elength, map, orl_count, stridx) /* Scribble out the ar header. */ amt = sizeof (struct ar_hdr); if (bfd_bwrite ((PTR) &hdr, amt, abfd) != amt) - return false; + return FALSE; /* Now scribble out the lst header. */ amt = sizeof (struct lst_header); if (bfd_bwrite ((PTR) &lst, amt, abfd) != amt) - return false; + return FALSE; /* Build and write the armap. */ if (!som_bfd_ar_write_symbol_stuff (abfd, nsyms, stringsize, lst, elength)) - return false; + return FALSE; /* Done. */ - return true; + return TRUE; } /* Free all information we have cached for this BFD. We can always read it again later if we need it. */ -static boolean +static bfd_boolean som_bfd_free_cached_info (abfd) bfd *abfd; { asection *o; if (bfd_get_format (abfd) != bfd_object) - return true; + return TRUE; #define FREE(x) if (x != NULL) { free (x); x = NULL; } /* Free the native string and symbol tables. */ @@ -6282,14 +6309,14 @@ som_bfd_free_cached_info (abfd) } #undef FREE - return true; + return TRUE; } /* End of miscellaneous support functions. */ /* Linker support functions. */ -static boolean +static bfd_boolean som_bfd_link_split_section (abfd, sec) bfd *abfd ATTRIBUTE_UNUSED; asection *sec; @@ -6310,7 +6337,7 @@ som_bfd_link_split_section (abfd, sec) #define som_update_armap_timestamp bfd_true #define som_bfd_print_private_bfd_data _bfd_generic_bfd_print_private_bfd_data -#define som_get_lineno _bfd_nosymbols_get_lineno +#define som_get_lineno _bfd_nosymbols_get_lineno #define som_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol #define som_read_minisymbols _bfd_generic_read_minisymbols #define som_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol |