From 1abaf976022c1e6b388292115d733f281c5a90e7 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Wed, 22 Nov 2000 00:56:55 +0000 Subject: 2000-11-21 Kazu Hirata * ecoff.c: Fix formatting. * ecofflink.c: Likewise. --- bfd/ChangeLog | 5 ++++ bfd/ecoff.c | 79 ++++++++++++++++++++++++++------------------------------- bfd/ecofflink.c | 52 ++++++++++++++++++------------------- 3 files changed, 65 insertions(+), 71 deletions(-) (limited to 'bfd') diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 228300f..d80dbde 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2000-11-21 Kazu Hirata + + * ecoff.c: Fix formatting. + * ecofflink.c: Likewise. + 2000-11-21 Nick Clifton * elf32-sh.c (sh_elf_reloc_loop): Fix compile time warning, and diff --git a/bfd/ecoff.c b/bfd/ecoff.c index 4b136ee..f22112b 100644 --- a/bfd/ecoff.c +++ b/bfd/ecoff.c @@ -1,5 +1,5 @@ /* Generic ECOFF (Extended-COFF) routines. - Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999 + Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. Original version by Per Bothner. Full support added by Ian Lance Taylor, ian@cygnus.com. @@ -344,9 +344,9 @@ ecoff_sec_to_styp_flags (name, flags) } else if (strcmp (name, _RCONST) == 0) styp = STYP_RCONST; - else if (flags & SEC_CODE) + else if (flags & SEC_CODE) styp = STYP_TEXT; - else if (flags & SEC_DATA) + else if (flags & SEC_DATA) styp = STYP_DATA; else if (flags & SEC_READONLY) styp = STYP_RDATA; @@ -363,7 +363,6 @@ ecoff_sec_to_styp_flags (name, flags) /* Get the BFD flags to use for a section. */ -/*ARGSUSED*/ flagword _bfd_ecoff_styp_to_sec_flags (abfd, hdr, name, section) bfd *abfd ATTRIBUTE_UNUSED; @@ -452,7 +451,7 @@ ecoff_slurp_symbolic_header (abfd) HDRR *internal_symhdr; /* See if we've already read it in. */ - if (ecoff_data (abfd)->debug_info.symbolic_header.magic == + if (ecoff_data (abfd)->debug_info.symbolic_header.magic == backend->debug_swap.sym_magic) return true; @@ -509,7 +508,6 @@ ecoff_slurp_symbolic_header (abfd) object file. This is called by gdb via the read_debug_info entry point in the backend structure. */ -/*ARGSUSED*/ boolean _bfd_ecoff_slurp_symbolic_info (abfd, ignore, debug) bfd *abfd; @@ -1090,7 +1088,7 @@ ecoff_emit_aggregate (abfd, fdr, string, rndx, isym, which) unsigned int ifd = rndx->rfd; unsigned int indx = rndx->index; const char *name; - + if (ifd == 0xfff) ifd = isym; @@ -1340,7 +1338,6 @@ ecoff_type_to_string (abfd, fdr, indx) p1 += strlen (buffer1); } - /* * Deal with any qualifiers. */ @@ -1406,7 +1403,7 @@ ecoff_type_to_string (abfd, fdr, indx) int j; /* Print array bounds reversed (ie, in the order the C - programmer writes them). C is such a fun language.... */ + programmer writes them). C is such a fun language.... */ while (i < 5 && qualifiers[i+1].type == tqArray) i++; @@ -1447,7 +1444,6 @@ ecoff_type_to_string (abfd, fdr, indx) /* Return information about ECOFF symbol SYMBOL in RET. */ -/*ARGSUSED*/ void _bfd_ecoff_get_symbol_info (abfd, symbol, ret) bfd *abfd ATTRIBUTE_UNUSED; @@ -1459,7 +1455,6 @@ _bfd_ecoff_get_symbol_info (abfd, symbol, ret) /* Return whether this is a local label. */ -/*ARGSUSED*/ boolean _bfd_ecoff_bfd_is_local_label_name (abfd, name) bfd *abfd ATTRIBUTE_UNUSED; @@ -1490,7 +1485,7 @@ _bfd_ecoff_print_symbol (abfd, filep, symbol, how) if (ecoffsymbol (symbol)->local) { SYMR ecoff_sym; - + (*debug_swap->swap_sym_in) (abfd, ecoffsymbol (symbol)->native, &ecoff_sym); fprintf (file, "ecoff local "); @@ -1604,7 +1599,7 @@ _bfd_ecoff_print_symbol (abfd, filep, symbol, how) fprintf (file, _("\n First symbol: %ld"), (long) (indx + sym_base)); else - fprintf (file, _("\n First symbol: %ld"), + fprintf (file, _("\n First symbol: %ld"), ((long) (AUX_GET_ISYM (bigendian, &aux_base[ecoff_ext.asym.index]) @@ -1680,7 +1675,7 @@ ecoff_slurp_reloc_table (abfd, section, symbols) if (_bfd_ecoff_slurp_symbol_table (abfd) == false) return false; - + internal_relocs = (arelent *) bfd_alloc (abfd, (sizeof (arelent) * section->reloc_count)); @@ -1778,7 +1773,7 @@ _bfd_ecoff_canonicalize_reloc (abfd, section, relptr, symbols) { unsigned int count; - if (section->flags & SEC_CONSTRUCTOR) + if (section->flags & SEC_CONSTRUCTOR) { arelent_chain *chain; @@ -1791,7 +1786,7 @@ _bfd_ecoff_canonicalize_reloc (abfd, section, relptr, symbols) *relptr++ = &chain->relent; } else - { + { arelent *tblptr; if (ecoff_slurp_reloc_table (abfd, section, symbols) == false) @@ -1812,7 +1807,6 @@ _bfd_ecoff_canonicalize_reloc (abfd, section, relptr, symbols) and return the name of the source file and the line nearest to the wanted location. */ -/*ARGSUSED*/ boolean _bfd_ecoff_find_nearest_line (abfd, section, ignore_symbols, offset, filename_ptr, functionname_ptr, retline_ptr) @@ -1984,7 +1978,6 @@ _bfd_ecoff_set_arch_mach (abfd, arch, machine) /* Get the size of the section headers. */ -/*ARGSUSED*/ int _bfd_ecoff_sizeof_headers (abfd, reloc) bfd *abfd; @@ -1996,8 +1989,8 @@ _bfd_ecoff_sizeof_headers (abfd, reloc) c = 0; for (current = abfd->sections; - current != (asection *)NULL; - current = current->next) + current != (asection *)NULL; + current = current->next) ++c; ret = (bfd_coff_filhsz (abfd) @@ -2218,13 +2211,13 @@ ecoff_compute_reloc_file_positions (abfd) abort (); abfd->output_has_begun = true; } - + reloc_base = ecoff_data (abfd)->reloc_filepos; reloc_size = 0; for (current = abfd->sections; - current != (asection *)NULL; - current = current->next) + current != (asection *)NULL; + current = current->next) { if (current->reloc_count == 0) current->rel_filepos = 0; @@ -2312,7 +2305,7 @@ bfd_ecoff_get_gp_value (abfd) bfd_set_error (bfd_error_invalid_operation); return 0; } - + return ecoff_data (abfd)->gp; } @@ -2491,8 +2484,8 @@ _bfd_ecoff_write_object_contents (abfd) count = 1; for (current = abfd->sections; - current != (asection *)NULL; - current = current->next) + current != (asection *)NULL; + current = current->next) { current->target_index = count; ++count; @@ -2630,7 +2623,7 @@ _bfd_ecoff_write_object_contents (abfd) /* Do nothing */ ; else abort (); - } + } /* Set up the file header. */ @@ -2782,7 +2775,7 @@ _bfd_ecoff_write_object_contents (abfd) arelent *reloc; asymbol *sym; struct internal_reloc in; - + memset ((PTR) &in, 0, sizeof in); reloc = *reloc_ptr_ptr; @@ -2982,7 +2975,7 @@ _bfd_ecoff_slurp_armap (abfd) char *raw_ptr; struct symdef *symdef_ptr; char *stringbase; - + /* Get the name of the first element. */ i = bfd_read ((PTR) nextname, 1, 16, abfd); if (i == 0) @@ -3034,11 +3027,11 @@ _bfd_ecoff_slurp_armap (abfd) return false; parsed_size = mapdata->parsed_size; bfd_release (abfd, (PTR) mapdata); - + raw_armap = (char *) bfd_alloc (abfd, parsed_size); if (raw_armap == (char *) NULL) return false; - + if (bfd_read ((PTR) raw_armap, 1, parsed_size, abfd) != parsed_size) { if (bfd_get_error () != bfd_error_system_call) @@ -3046,7 +3039,7 @@ _bfd_ecoff_slurp_armap (abfd) bfd_release (abfd, (PTR) raw_armap); return false; } - + ardata->tdata = (PTR) raw_armap; count = bfd_h_get_32 (abfd, (PTR) raw_armap); @@ -3075,7 +3068,7 @@ _bfd_ecoff_slurp_armap (abfd) { unsigned int name_offset, file_offset; unsigned int hash, rehash, srch; - + name_offset = bfd_h_get_32 (abfd, (PTR) raw_ptr); file_offset = bfd_h_get_32 (abfd, (PTR) (raw_ptr + 4)); if (file_offset == 0) @@ -3167,7 +3160,7 @@ _bfd_ecoff_write_armap (abfd, elength, map, orl_count, stridx) padit = stridx % 2; stringsize = stridx + padit; - /* Include 8 bytes to store symdefsize and stringsize in output. */ + /* Include 8 bytes to store symdefsize and stringsize in output. */ mapsize = symdefsize + stringsize + 8; firstreal = SARMAG + sizeof (struct ar_hdr) + mapsize + elength; @@ -3201,7 +3194,7 @@ _bfd_ecoff_write_armap (abfd, elength, map, orl_count, stridx) #if 0 hdr.ar_mode[0] = '0'; #else - /* Building gcc ends up extracting the armap as a file - twice. */ + /* Building gcc ends up extracting the armap as a file - twice. */ hdr.ar_mode[0] = '6'; hdr.ar_mode[1] = '4'; hdr.ar_mode[2] = '4'; @@ -3214,8 +3207,8 @@ _bfd_ecoff_write_armap (abfd, elength, map, orl_count, stridx) /* Turn all null bytes in the header into spaces. */ for (i = 0; i < sizeof (struct ar_hdr); i++) - if (((char *)(&hdr))[i] == '\0') - (((char *)(&hdr))[i]) = ' '; + if (((char *) (&hdr))[i] == '\0') + (((char *) (&hdr))[i]) = ' '; if (bfd_write ((PTR) &hdr, 1, sizeof (struct ar_hdr), abfd) != sizeof (struct ar_hdr)) @@ -3224,7 +3217,7 @@ _bfd_ecoff_write_armap (abfd, elength, map, orl_count, stridx) bfd_h_put_32 (abfd, (bfd_vma) hashsize, temp); if (bfd_write ((PTR) temp, 1, 4, abfd) != 4) return false; - + hashtable = (bfd_byte *) bfd_zalloc (abfd, symdefsize); if (!hashtable) return false; @@ -3266,7 +3259,7 @@ _bfd_ecoff_write_armap (abfd, elength, map, orl_count, stridx) hash = srch; } - + bfd_h_put_32 (abfd, (bfd_vma) map[i].namidx, (PTR) (hashtable + hash * 8)); bfd_h_put_32 (abfd, (bfd_vma) firstreal, @@ -3345,7 +3338,7 @@ _bfd_ecoff_archive_p (abfd) bfd_ardata (abfd)->symdefs = NULL; bfd_ardata (abfd)->extended_names = NULL; bfd_ardata (abfd)->tdata = NULL; - + if (_bfd_ecoff_slurp_armap (abfd) == false || _bfd_ecoff_slurp_extended_name_table (abfd) == false) { @@ -3353,7 +3346,7 @@ _bfd_ecoff_archive_p (abfd) abfd->tdata.aout_ar_data = tdata_hold; return (const bfd_target *) NULL; } - + if (bfd_has_map (abfd)) { bfd *first; @@ -4391,7 +4384,7 @@ ecoff_link_write_external (h, data) bfd *output_bfd = einfo->abfd; boolean strip; - /* We need to check if this symbol is being stripped. */ + /* We need to check if this symbol is being stripped. */ if (h->root.type == bfd_link_hash_undefined || h->root.type == bfd_link_hash_undefweak) strip = false; @@ -4427,7 +4420,7 @@ ecoff_link_write_external (h, data) output_section = h->root.u.def.section->output_section; name = bfd_section_name (output_section->owner, output_section); - + if (strcmp (name, _TEXT) == 0) h->esym.asym.sc = scText; else if (strcmp (name, _DATA) == 0) diff --git a/bfd/ecofflink.c b/bfd/ecofflink.c index 25fc966..9b2e0f5 100644 --- a/bfd/ecofflink.c +++ b/bfd/ecofflink.c @@ -1,5 +1,5 @@ /* Routines to link ECOFF debugging information. - Copyright 1993, 94, 95, 96, 97, 1999 Free Software Foundation, Inc. + Copyright 1993, 94, 95, 96, 97, 99, 2000 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support, . This file is part of BFD, the Binary File Descriptor library. @@ -69,8 +69,8 @@ _bfd_ecoff_swap_tir_in (bigend, ext_copy, intern) struct tir_ext ext[1]; *ext = *ext_copy; /* Make it reasonable to do in-place. */ - - /* now the fun stuff... */ + + /* now the fun stuff... */ if (bigend) { intern->fBitfield = 0 != (ext->t_bits1[0] & TIR_BITS1_FBITFIELD_BIG); intern->continued = 0 != (ext->t_bits1[0] & TIR_BITS1_CONTINUED_BIG); @@ -109,7 +109,7 @@ _bfd_ecoff_swap_tir_in (bigend, ext_copy, intern) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } @@ -126,8 +126,8 @@ _bfd_ecoff_swap_tir_out (bigend, intern_copy, ext) TIR intern[1]; *intern = *intern_copy; /* Make it reasonable to do in-place. */ - - /* now the fun stuff... */ + + /* now the fun stuff... */ if (bigend) { ext->t_bits1[0] = ((intern->fBitfield ? TIR_BITS1_FBITFIELD_BIG : 0) | (intern->continued ? TIR_BITS1_CONTINUED_BIG : 0) @@ -166,7 +166,7 @@ _bfd_ecoff_swap_tir_out (bigend, intern_copy, ext) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } @@ -182,8 +182,8 @@ _bfd_ecoff_swap_rndx_in (bigend, ext_copy, intern) struct rndx_ext ext[1]; *ext = *ext_copy; /* Make it reasonable to do in-place. */ - - /* now the fun stuff... */ + + /* now the fun stuff... */ if (bigend) { intern->rfd = (ext->r_bits[0] << RNDX_BITS0_RFD_SH_LEFT_BIG) | ((ext->r_bits[1] & RNDX_BITS1_RFD_BIG) @@ -205,7 +205,7 @@ _bfd_ecoff_swap_rndx_in (bigend, ext_copy, intern) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } @@ -221,8 +221,8 @@ _bfd_ecoff_swap_rndx_out (bigend, intern_copy, ext) RNDXR intern[1]; *intern = *intern_copy; /* Make it reasonable to do in-place. */ - - /* now the fun stuff... */ + + /* now the fun stuff... */ if (bigend) { ext->r_bits[0] = intern->rfd >> RNDX_BITS0_RFD_SH_LEFT_BIG; ext->r_bits[1] = (((intern->rfd << RNDX_BITS1_RFD_SH_BIG) @@ -243,7 +243,7 @@ _bfd_ecoff_swap_rndx_out (bigend, intern_copy, ext) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } @@ -465,7 +465,7 @@ add_memory_shuffle (ainfo, head, tail, data, size) unsigned long size; { struct shuffle *n; - + n = (struct shuffle *) objalloc_alloc (ainfo->memory, sizeof (struct shuffle)); if (!n) @@ -488,7 +488,6 @@ add_memory_shuffle (ainfo, head, tail, data, size) /* Initialize the FDR hash table. This returns a handle which is then passed in to bfd_ecoff_debug_accumulate, et. al. */ -/*ARGSUSED*/ PTR bfd_ecoff_debug_init (output_bfd, output_debug, output_swap, info) bfd *output_bfd ATTRIBUTE_UNUSED; @@ -547,7 +546,6 @@ bfd_ecoff_debug_init (output_bfd, output_debug, output_swap, info) /* Free the accumulated debugging information. */ -/*ARGSUSED*/ void bfd_ecoff_debug_free (handle, output_bfd, output_debug, output_swap, info) PTR handle; @@ -557,7 +555,7 @@ bfd_ecoff_debug_free (handle, output_bfd, output_debug, output_swap, info) struct bfd_link_info *info; { struct accumulate *ainfo = (struct accumulate *) handle; - + bfd_hash_table_free (&ainfo->fdr_hash.table); if (! info->relocateable) @@ -576,7 +574,6 @@ bfd_ecoff_debug_free (handle, output_bfd, output_debug, output_swap, info) linker information structure. HANDLE is returned by bfd_ecoff_debug_init. */ -/*ARGSUSED*/ boolean bfd_ecoff_debug_accumulate (handle, output_bfd, output_debug, output_swap, input_bfd, input_debug, input_swap, @@ -1409,7 +1406,6 @@ bfd_ecoff_debug_one_external (abfd, debug, swap, name, esym) /* Align the ECOFF debugging information. */ -/*ARGSUSED*/ static void ecoff_align_debug (abfd, debug, swap) bfd *abfd ATTRIBUTE_UNUSED; @@ -1967,9 +1963,9 @@ lookup_line (abfd, debug_info, debug_swap, line_info) boolean stabs; FDR *fdr_ptr; int i; - + offset = line_info->cache.start; - + /* Build FDR table (sorted by object file's base-address) if we don't have it already. */ if (line_info->fdrtab == NULL @@ -1981,7 +1977,7 @@ lookup_line (abfd, debug_info, debug_swap, line_info) /* find first FDR for address OFFSET */ i = fdrtab_lookup (line_info, offset); if (i < 0) - return false; /* no FDR, no fun... */ + return false; /* no FDR, no fun... */ fdr_ptr = tab[i].fdr; /* Check whether this file has stabs debugging information. In a @@ -2046,9 +2042,9 @@ lookup_line (abfd, debug_info, debug_swap, line_info) malloc.c. I'm not sure why this happens, but it could be due to optimizations that reorder a function's position within an object-file. - + Strategy: - + On the first call to this function, we build a table of FDRs that is sorted by the base-address of the object-file the FDR is referring to. Notice that each object-file may contain @@ -2079,9 +2075,9 @@ lookup_line (abfd, debug_info, debug_swap, line_info) bfd_vma dist, min_dist = 0; char *pdr_hold; char *pdr_end; - + fdr_ptr = tab[i].fdr; - + pdr_ptr = ((char *) debug_info->external_pdr + fdr_ptr->ipdFirst * external_pdr_size); pdr_end = pdr_ptr + fdr_ptr->cpd * external_pdr_size; @@ -2106,7 +2102,7 @@ lookup_line (abfd, debug_info, debug_swap, line_info) } } } - + if (!best_pdr || min_dist < best_dist) { best_dist = min_dist; @@ -2119,7 +2115,7 @@ lookup_line (abfd, debug_info, debug_swap, line_info) && tab[i].base_addr == tab[i - 1].base_addr); if (!best_fdr || !best_pdr) - return false; /* shouldn't happen... */ + return false; /* shouldn't happen... */ /* phew, finally we got something that we can hold onto: */ fdr_ptr = best_fdr; -- cgit v1.1