+Fri Dec 31 16:23:43 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ Minor cleanups suggested by CodeCenter.
+ * aoutx.h, coffgen.c, ecoff.c, ecofflink.c, elf.c, libbfd.c,
+ linker.c, reloc.c, section.c, srec.c: Added /*ARGSUSED*/ as
+ appropriate.
+ * aoutx.h (struct external_exec): Removed unnecessary declaration.
+ (NAME(aout,some_aout_object_p)): Set some tdata pointers to NULL.
+ (adjust_z_magic): Removed useless variable data_vma.
+ (stringtab_init): Initialize hash_zero.
+ (add_to_stringtab): Removed unused fourth argument.
+ (NAME(aout,swap_std_reloc_out)): Removed useless variable
+ r_addend.
+ (aout_link_input_section): Added some casts.
+ * archive.c (get_extended_arelt_filename, do_slurp_coff_armap,
+ bfd_ar_hdr_from_filesystem, bsd_write_armap, coff_write_armap):
+ Minor code rewriting to make it more C like.
+ (do_slurp_bsd_armap): Added some casts.
+ * ecoff.c (ecoff_write_object_contents): Removed useless variable
+ scn_base.
+ (ecoff_write_armap): Added some casts. Use "" rather than "\0".
+ * ecofflink.c (bfd_ecoff_write_debug): Added a cast.
+ * libaout.h (struct internal_exec): Removed unnecessary
+ declaration.
+ * linker.c (_bfd_generic_indirect_link_order): Added a cast.
+ * opncls.c (new_bfd): Removed a cast.
+ * reloc.c (bfd_generic_get_relocated_section_contents): Added
+ some casts.
+ * srec.c (internal_srec_write_object_contents): Removed useless
+ variable bytes_written.
+
Fri Dec 31 11:46:13 1993 David J. Mackenzie (djm@thepub.cygnus.com)
* i386mach3.c (N_TXTADDR): Don't define after all.
#include <ansidecl.h>
#include "bfdlink.h"
-struct external_exec;
#include "libaout.h"
#include "libbfd.h"
#include "aout/aout64.h"
/* The default symbol entry size is that of traditional Unix. */
obj_symbol_entry_size (abfd) = EXTERNAL_NLIST_SIZE;
+ obj_aout_external_syms (abfd) = NULL;
+ obj_aout_external_strings (abfd) = NULL;
+ obj_aout_sym_hashes (abfd) = NULL;
+
/* Create the sections. This is raunchy, but bfd_close wants to reclaim
them. */
file_ptr text_end;
CONST struct aout_backend_data *abdp;
int ztih; /* Nonzero if text includes exec header. */
- bfd_vma data_vma;
abdp = aout_backend_info (abfd);
vma = obj_textsec(abfd)->vma + obj_textsec(abfd)->_raw_size;
obj_datasec(abfd)->vma = BFD_ALIGN (vma, adata(abfd).segment_size);
}
- data_vma = obj_datasec(abfd)->vma;
if (abdp && abdp->zmagic_mapped_contiguous)
{
text_pad = (obj_datasec(abfd)->vma
{
tab->strings = 0;
tab->output_order = 0;
+ tab->hash_zero = 0;
tab->end = &tab->output_order;
/* Initial string table length includes size of length field. */
entry into the string table should be irrelevant -- it just has to
return a valid index. */
static bfd_size_type
-add_to_stringtab (abfd, str, tab, check)
+add_to_stringtab (abfd, str, tab)
bfd *abfd;
CONST char *str;
struct stringtab_data *tab;
- int check;
{
struct stringtab_entry **ep;
register struct stringtab_entry *entry;
unsigned int r_length;
int r_pcrel;
int r_baserel, r_jmptable, r_relative;
- unsigned int r_addend;
asection *output_section = sym->section->output_section;
PUT_WORD(abfd, g->address, natptr->r_address);
r_jmptable = 0;
r_relative = 0;
+#if 0
+ /* For a standard reloc, the addend is in the object file. */
r_addend = g->addend + (*(g->sym_ptr_ptr))->section->output_section->vma;
+#endif
/* name was clobbered by aout_write_syms to be symbol index */
return (bfd_get_symcount (abfd)+1) * (sizeof (aout_symbol_type *));
}
+
+/*ARGSUSED*/
alent *
DEFUN(NAME(aout,get_lineno),(ignore_abfd, ignore_symbol),
bfd *ignore_abfd AND
return (alent *)NULL;
}
+/*ARGSUSED*/
void
DEFUN(NAME(aout,get_symbol_info),(ignore_abfd, symbol, ret),
bfd *ignore_abfd AND
}
}
+/*ARGSUSED*/
void
DEFUN(NAME(aout,print_symbol),(ignore_abfd, afile, symbol, how),
bfd *ignore_abfd AND
}
+/*ARGSUSED*/
int
DEFUN(NAME(aout,sizeof_headers),(abfd, execable),
bfd *abfd AND
else
copy = true;
-
/* We keep a list of the linker hash table entries that correspond
to particular symbols. We could just look them up in the hash
table, but keeping the list is more efficient. Perhaps this
/* Get the section contents. */
input_size = bfd_section_size (input_bfd, input_section);
contents = (bfd_byte *) alloca (input_size);
- if (! bfd_get_section_contents (input_bfd, input_section, contents,
+ if (! bfd_get_section_contents (input_bfd, input_section, (PTR) contents,
(file_ptr) 0, input_size))
return false;
/* Write out the section contents. */
if (! bfd_set_section_contents (finfo->output_bfd,
input_section->output_section,
- contents, input_section->output_offset,
+ (PTR) contents,
+ input_section->output_offset,
input_size))
return false;
information, returning that symbol's (internal) index into the
symbol table.
- Supply BFD_NO_MORE_SYMBOLS as the @var{previous} entry to get
- the first one; returns BFD_NO_MORE_SYMBOLS when you're already
+ Supply <<BFD_NO_MORE_SYMBOLS>> as the @var{previous} entry to get
+ the first one; returns <<BFD_NO_MORE_SYMBOLS>> when you've already
got the last one.
A <<carsym>> is a canonical archive symbol. The only
else {
struct ar_cache *current = bfd_ardata (arch_bfd)->cache;
- for (; current->next != NULL; current = current->next);
+ while (current->next != NULL)
+ current = current->next;
current->next = new_cache;
}
return false;
}
- ardata->symdef_count =
- bfd_h_get_32(abfd, (PTR)raw_armap) / sizeof (struct symdef);
+ ardata->symdef_count = (bfd_h_get_32 (abfd, (bfd_byte *) raw_armap)
+ / sizeof (struct symdef));
if (ardata->symdef_count * sizeof (struct symdef)
> parsed_size - sizeof (*raw_armap)) {
for (;counter < ardata->symdef_count; counter++) {
struct symdef *sym = ((struct symdef *) rbase) + counter;
- sym->s.name = bfd_h_get_32(abfd, (PTR)(&(sym->s.string_offset))) + stringbase;
- sym->file_offset = bfd_h_get_32(abfd, (PTR)( &(sym->file_offset)));
+ sym->s.name = (bfd_h_get_32 (abfd, (bfd_byte *) (&sym->s.string_offset))
+ + stringbase);
+ sym->file_offset = bfd_h_get_32 (abfd,
+ (bfd_byte *) (&(sym->file_offset)));
}
ardata->first_file_filepos = bfd_tell (abfd);
rawptr = raw_armap + i;
carsyms->file_offset = swap((PTR)rawptr);
carsyms->name = stringbase;
- while (*stringbase++) ;
+ stringbase += strlen (stringbase) + 1;
carsyms++;
}
*stringbase = 0;
hdr = (struct ar_hdr *) (((char *) ared) + sizeof (struct areltdata));
/* ar headers are space padded, not null padded! */
- temp = (char *) hdr;
- temp1 = temp + sizeof (struct ar_hdr) - 2;
- for (; temp < temp1; *(temp++) = ' ');
+ memset (hdr, ' ', sizeof (struct ar_hdr));
+
strncpy (hdr->ar_fmag, ARFMAG, 2);
/* Goddamned sprintf doesn't permit MAXIMUM field lengths */
/* The spec sez this should be a newline. But in order to be
bug-compatible for sun's ar we use a null. */
if (padit)
- bfd_write("\0",1,1,arch);
+ bfd_write("",1,1,arch);
return true;
}
/* The spec sez this should be a newline. But in order to be
bug-compatible for arc960 we use a null. */
if (padit)
- bfd_write("\0",1,1,arch);
+ bfd_write("",1,1,arch);
return true;
}
/* This is a hook needed by SCO COFF, but we have nothing to do. */
+/*ARGSUSED*/
asection *
ecoff_make_section_hook (abfd, name)
bfd *abfd;
/* Get the BFD flags to use for a section. */
+/*ARGSUSED*/
flagword
ecoff_styp_to_sec_flags (abfd, hdr)
bfd *abfd;
/* Return information about ECOFF symbol SYMBOL in RET. */
+/*ARGSUSED*/
void
ecoff_get_symbol_info (abfd, symbol, ret)
bfd *abfd; /* Ignored. */
and return the name of the source file and the line nearest to the
wanted location. */
+/*ARGSUSED*/
boolean
ecoff_find_nearest_line (abfd,
section,
/* Get the size of the section headers. We do not output the .reginfo
section. */
+/*ARGSUSED*/
int
ecoff_sizeof_headers (abfd, reloc)
bfd *abfd;
HDRR * const symhdr = &debug->symbolic_header;
asection *current;
unsigned int count;
- file_ptr scn_base;
file_ptr reloc_base;
file_ptr sym_base;
unsigned long reloc_size;
if(abfd->output_has_begun == false)
ecoff_compute_section_file_positions(abfd);
- if (abfd->sections != (asection *) NULL)
- scn_base = abfd->sections->filepos;
- else
- scn_base = 0;
reloc_base = ecoff_data (abfd)->reloc_filepos;
count = 1;
return false;
bfd_h_put_32 (abfd, (bfd_vma) hashsize, temp);
- if (bfd_write (temp, 1, 4, abfd) != 4)
+ if (bfd_write ((PTR) temp, 1, 4, abfd) != 4)
return false;
hashtable = (bfd_byte *) bfd_zalloc (abfd, symdefsize);
(PTR) (hashtable + hash * 8 + 4));
}
- if (bfd_write (hashtable, 1, symdefsize, abfd) != symdefsize)
+ if (bfd_write ((PTR) hashtable, 1, symdefsize, abfd) != symdefsize)
return false;
bfd_release (abfd, hashtable);
/* Now write the strings. */
bfd_h_put_32 (abfd, (bfd_vma) stringsize, temp);
- if (bfd_write (temp, 1, 4, abfd) != 4)
+ if (bfd_write ((PTR) temp, 1, 4, abfd) != 4)
return false;
for (i = 0; i < orl_count; i++)
{
bug-compatible for DECstation ar we use a null. */
if (padit)
{
- if (bfd_write ("\0", 1, 1, abfd) != 1)
+ if (bfd_write ("", 1, 1, abfd) != 1)
return false;
}
#define BYTES_IN_WORD 4
#endif /* ARCH_SIZE==32 */
-/* Declare these types at file level, since they are used in parameter
- lists, which have wierd scope. */
+/* Declare at file level, since it isused in parameter lists, which
+ have weird scope. */
struct external_exec;
-struct internal_exec;
/* Back-end information for various a.out targets. */
struct aout_backend_data
completeness.
*/
+/*ARGSUSED*/
boolean
DEFUN(_bfd_dummy_new_section_hook,(ignore, ignore_newsect),
bfd *ignore AND
return true;
}
+/*ARGSUSED*/
boolean
DEFUN(bfd_false ,(ignore),
bfd *ignore)
return false;
}
+/*ARGSUSED*/
boolean
DEFUN(bfd_true,(ignore),
bfd *ignore)
return true;
}
+/*ARGSUSED*/
PTR
DEFUN(bfd_nullvoidptr,(ignore),
bfd *ignore)
return (PTR)NULL;
}
+/*ARGSUSED*/
int
DEFUN(bfd_0,(ignore),
bfd *ignore)
return 0;
}
+/*ARGSUSED*/
unsigned int
DEFUN(bfd_0u,(ignore),
bfd *ignore)
return 0;
}
+/*ARGSUSED*/
void
DEFUN(bfd_void,(ignore),
bfd *ignore)
{
}
+/*ARGSUSED*/
boolean
DEFUN(_bfd_dummy_core_file_matches_executable_p,(ignore_core_bfd, ignore_exec_bfd),
bfd *ignore_core_bfd AND
/* of course you can't initialize a function to be the same as another, grr */
+/*ARGSUSED*/
char *
DEFUN(_bfd_dummy_core_file_failing_command,(ignore_abfd),
bfd *ignore_abfd)
return (char *)NULL;
}
+/*ARGSUSED*/
int
DEFUN(_bfd_dummy_core_file_failing_signal,(ignore_abfd),
bfd *ignore_abfd)
return 0;
}
+/*ARGSUSED*/
bfd_target *
DEFUN(_bfd_dummy_target,(ignore_abfd),
bfd *ignore_abfd)