This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
various bfd warning fixes
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: binutils at sources dot redhat dot com
- Date: Mon, 16 Aug 2004 09:53:58 +0930
- Subject: various bfd warning fixes
bfd/ChangeLog
* pdp11.c (struct pdp11_aout_reloc_external): Delete. Replace
occurrences with bfd_btye * thoughout file.
* coff-rs6000.c (do_shared_object_padding): Warning fix.
(xcoff_write_armap_big): Likewise.
(xcoff_write_archive_contents_old): Likewise.
(xcoff_write_archive_contents_big): Likewise.
* elf64-mmix.c (mmix_elf_get_section_contents): Delete declaration.
Index: bfd/coff-rs6000.c
===================================================================
RCS file: /cvs/src/src/bfd/coff-rs6000.c,v
retrieving revision 1.63
diff -u -p -r1.63 coff-rs6000.c
--- bfd/coff-rs6000.c 13 Aug 2004 03:15:56 -0000 1.63
+++ bfd/coff-rs6000.c 16 Aug 2004 00:14:16 -0000
@@ -180,7 +180,7 @@ static bfd_boolean do_pad
static bfd_boolean do_copy
PARAMS ((bfd *, bfd *));
static bfd_boolean do_shared_object_padding
- PARAMS ((bfd *, bfd *, ufile_ptr *, int));
+ PARAMS ((bfd *, bfd *, file_ptr *, int));
/* Relocation functions */
static bfd_boolean xcoff_reloc_type_br
@@ -1742,7 +1742,7 @@ static bfd_boolean
do_shared_object_padding (out_bfd, in_bfd, offset, ar_header_size)
bfd *out_bfd;
bfd *in_bfd;
- ufile_ptr *offset;
+ file_ptr *offset;
int ar_header_size;
{
if (bfd_check_format (in_bfd, bfd_object)
@@ -1779,7 +1779,7 @@ xcoff_write_armap_big (abfd, elength, ma
const bfd_arch_info_type *arch_info = NULL;
bfd *current_bfd;
size_t string_length;
- ufile_ptr nextoff, prevoff;
+ file_ptr nextoff, prevoff;
/* First, we look through the symbols and work out which are
from 32-bit objects and which from 64-bit ones. */
@@ -2076,7 +2076,7 @@ xcoff_write_archive_contents_old (abfd)
file_ptr *offsets;
bfd_boolean makemap;
bfd_boolean hasobjects;
- ufile_ptr prevoff, nextoff;
+ file_ptr prevoff, nextoff;
bfd *sub;
size_t i;
struct xcoff_ar_hdr ahdr;
@@ -2306,7 +2306,7 @@ xcoff_write_archive_contents_big (abfd)
file_ptr *offsets;
bfd_boolean makemap;
bfd_boolean hasobjects;
- ufile_ptr prevoff, nextoff;
+ file_ptr prevoff, nextoff;
bfd *current_bfd;
size_t i;
struct xcoff_ar_hdr_big *hdr, ahdr;
Index: bfd/elf64-mmix.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-mmix.c,v
retrieving revision 1.38
diff -u -p -r1.38 elf64-mmix.c
--- bfd/elf64-mmix.c 29 Jun 2004 14:13:44 -0000 1.38
+++ bfd/elf64-mmix.c 16 Aug 2004 00:14:22 -0000
@@ -229,10 +229,6 @@ static void
mmix_set_relaxable_size
PARAMS ((bfd *, asection *, void *));
-static bfd_boolean
-mmix_elf_get_section_contents
- PARAMS ((bfd *, sec_ptr, void *, file_ptr, bfd_size_type));
-
/* Watch out: this currently needs to have elements with the same index as
their R_MMIX_ number. */
Index: bfd/pdp11.c
===================================================================
RCS file: /cvs/src/src/bfd/pdp11.c,v
retrieving revision 1.24
diff -u -p -r1.24 pdp11.c
--- bfd/pdp11.c 13 Aug 2004 03:16:00 -0000 1.24
+++ bfd/pdp11.c 16 Aug 2004 00:14:29 -0000
@@ -341,11 +341,6 @@ DESCRIPTION
#define RELOC_SIZE 2
-struct pdp11_aout_reloc_external
-{
- bfd_byte e_reloc_entry[2];
-};
-
#define RELFLG 0x0001 /* pc-relative flag */
#define RTYPE 0x000e /* type mask */
#define RIDXMASK 0xfff0 /* index mask */
@@ -368,9 +363,9 @@ static void adjust_z_magic PARAMS ((bfd
static void adjust_n_magic PARAMS ((bfd *, struct internal_exec *));
static int pdp11_aout_write_headers PARAMS ((bfd *, struct internal_exec *));
-void pdp11_aout_swap_reloc_out PARAMS ((bfd *, arelent *, struct pdp11_aout_reloc_external *));
+void pdp11_aout_swap_reloc_out PARAMS ((bfd *, arelent *, bfd_byte *));
void pdp11_aout_swap_reloc_in
-PARAMS ((bfd *, struct pdp11_aout_reloc_external *, arelent *,
+PARAMS ((bfd *, bfd_byte *, arelent *,
bfd_size_type, asymbol **, bfd_size_type));
/*
@@ -2032,7 +2027,7 @@ void
pdp11_aout_swap_reloc_out (abfd, g, natptr)
bfd *abfd;
arelent *g;
- register struct pdp11_aout_reloc_external *natptr;
+ bfd_byte *natptr;
{
int r_index;
int r_pcrel;
@@ -2094,7 +2089,7 @@ pdp11_aout_swap_reloc_out (abfd, g, natp
reloc_entry = r_index << 4 | r_type | r_pcrel;
- PUT_WORD (abfd, reloc_entry, natptr->e_reloc_entry);
+ PUT_WORD (abfd, reloc_entry, natptr);
}
/* BFD deals internally with all things based from the section they're
@@ -2147,7 +2142,7 @@ void
pdp11_aout_swap_reloc_in (abfd, bytes, cache_ptr, offset,
symbols, symcount)
bfd *abfd;
- struct pdp11_aout_reloc_external *bytes;
+ bfd_byte *bytes;
arelent *cache_ptr;
bfd_size_type offset;
asymbol **symbols;
@@ -2194,7 +2189,7 @@ NAME(aout,slurp_reloc_table) (abfd, asec
sec_ptr asect;
asymbol **symbols;
{
- struct pdp11_aout_reloc_external *rptr;
+ bfd_byte *rptr;
bfd_size_type count;
bfd_size_type reloc_size;
PTR relocs;
@@ -2260,16 +2255,14 @@ NAME(aout,slurp_reloc_table) (abfd, asec
cache_ptr = reloc_cache;
- rptr = (struct pdp11_aout_reloc_external *) relocs;
+ rptr = relocs;
for (counter = 0;
counter < count;
- counter++, ((char *)rptr) += RELOC_SIZE, cache_ptr++)
+ counter++, rptr += RELOC_SIZE, cache_ptr++)
{
while (GET_WORD (abfd, (PTR)rptr) == 0)
{
- rptr =
- (struct pdp11_aout_reloc_external *)
- ((char *) rptr + RELOC_SIZE);
+ rptr += RELOC_SIZE;
if ((char *) rptr >= (char *) relocs + reloc_size)
goto done;
}
@@ -2322,10 +2315,9 @@ NAME(aout,squirt_out_relocs) (abfd, sect
{
while (count > 0)
{
- struct pdp11_aout_reloc_external *r;
+ bfd_byte *r;
- r = (struct pdp11_aout_reloc_external *)
- (native + (*generic)->address);
+ r = native + (*generic)->address;
pdp11_aout_swap_reloc_out (abfd, *generic, r);
count--;
generic++;
@@ -3354,7 +3346,7 @@ static bfd_boolean pdp11_aout_link_input
PARAMS ((struct aout_final_link_info *finfo,
bfd *input_bfd,
asection *input_section,
- struct pdp11_aout_reloc_external *relocs,
+ bfd_byte *relocs,
bfd_size_type rel_size,
bfd_byte *contents));
@@ -4445,7 +4437,7 @@ aout_link_input_section (finfo, input_bf
/* Relocate the section contents. */
if (! pdp11_aout_link_input_section (finfo, input_bfd, input_section,
- (struct pdp11_aout_reloc_external *) relocs,
+ (bfd_byte *) relocs,
rel_size, finfo->contents))
return FALSE;
@@ -4509,7 +4501,7 @@ pdp11_aout_link_input_section (finfo, in
struct aout_final_link_info *finfo;
bfd *input_bfd;
asection *input_section;
- struct pdp11_aout_reloc_external *relocs;
+ bfd_byte *relocs;
bfd_size_type rel_size;
bfd_byte *contents;
{
@@ -4524,8 +4516,8 @@ pdp11_aout_link_input_section (finfo, in
struct aout_link_hash_entry **sym_hashes;
int *symbol_map;
bfd_size_type reloc_count;
- register struct pdp11_aout_reloc_external *rel;
- struct pdp11_aout_reloc_external *rel_end;
+ bfd_byte *rel;
+ bfd_byte *rel_end;
output_bfd = finfo->output_bfd;
check_dynamic_reloc = aout_backend_info (output_bfd)->check_dynamic_reloc;
@@ -4542,8 +4534,8 @@ pdp11_aout_link_input_section (finfo, in
reloc_count = rel_size / RELOC_SIZE;
rel = relocs;
- rel_end = (struct pdp11_aout_reloc_external *)(((char *)rel) + rel_size);
- for (; rel < rel_end; ((char *)rel) += RELOC_SIZE)
+ rel_end = rel + rel_size;
+ for (; rel < rel_end; rel += RELOC_SIZE)
{
bfd_vma r_addr;
int r_index;
@@ -4651,10 +4643,10 @@ pdp11_aout_link_input_section (finfo, in
}
/* Write out the new r_index value. */
- reloc_entry = GET_WORD (input_bfd, rel->e_reloc_entry);
+ reloc_entry = GET_WORD (input_bfd, rel);
reloc_entry &= RIDXMASK;
reloc_entry |= r_index << 4;
- PUT_WORD (input_bfd, reloc_entry, rel->e_reloc_entry);
+ PUT_WORD (input_bfd, reloc_entry, rel);
}
else
{
--
Alan Modra
IBM OzLabs - Linux Technology Centre