* bfd warning fixes
@ 2005-02-17 16:07 Alan Modra
0 siblings, 0 replies; 3+ messages in thread
From: Alan Modra @ 2005-02-17 16:07 UTC (permalink / raw)
To: binutils
Fixes gcc-4.0 fussing about possible use of an uninitialized struct
component.
bfd/
* elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Fix warning.
Index: bfd/elf-eh-frame.c
===================================================================
RCS file: /cvs/src/src/bfd/elf-eh-frame.c,v
retrieving revision 1.42
diff -u -p -r1.42 elf-eh-frame.c
--- bfd/elf-eh-frame.c 31 Jan 2005 20:39:08 -0000 1.42
+++ bfd/elf-eh-frame.c 17 Feb 2005 11:14:19 -0000
@@ -482,6 +482,7 @@ _bfd_elf_discard_section_eh_frame
on whether to output or discard last encountered CIE (if any). */
if ((bfd_size_type) (buf - ehbuf) == sec->size)
{
+ hdr.length = 0;
hdr.id = (unsigned int) -1;
end = buf;
}
--
Alan Modra
IBM OzLabs - Linux Technology Centre
^ permalink raw reply [flat|nested] 3+ messages in thread
* bfd warning fixes
@ 2004-11-19 11:57 Alan Modra
0 siblings, 0 replies; 3+ messages in thread
From: Alan Modra @ 2004-11-19 11:57 UTC (permalink / raw)
To: binutils
* elf32-arm.c (elf32_arm_finish_dynamic_sections): Warning fix.
* elf32-iq2000.c (iq2000_reloc_type_lookup): C90 function decl.
* nlmcode.h (nlm_write_object_contents): Warning fix.
Index: bfd/elf32-arm.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-arm.c,v
retrieving revision 1.9
diff -u -p -r1.9 elf32-arm.c
--- bfd/elf32-arm.c 17 Nov 2004 17:50:23 -0000 1.9
+++ bfd/elf32-arm.c 19 Nov 2004 11:02:39 -0000
@@ -5314,8 +5314,8 @@ elf32_arm_finish_dynamic_sections (bfd *
if (dyn.d_tag == DT_RELSZ
|| dyn.d_tag == DT_RELASZ)
dyn.d_un.d_val += hdr->sh_size;
- else if (dyn.d_un.d_val == 0
- || hdr->sh_offset < dyn.d_un.d_val)
+ else if ((ufile_ptr) hdr->sh_offset
+ <= dyn.d_un.d_val - 1)
dyn.d_un.d_val = hdr->sh_offset;
}
}
Index: bfd/elf32-iq2000.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-iq2000.c,v
retrieving revision 1.9
diff -u -p -r1.9 elf32-iq2000.c
--- bfd/elf32-iq2000.c 2 Nov 2004 12:52:32 -0000 1.9
+++ bfd/elf32-iq2000.c 19 Nov 2004 11:02:39 -0000
@@ -330,9 +330,8 @@ iq2000_elf_relocate_hi16 (bfd *input_bfd
}
static reloc_howto_type *
-iq2000_reloc_type_lookup (abfd, code)
- bfd * abfd ATTRIBUTE_UNUSED;
- bfd_reloc_code_real_type code;
+iq2000_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+ bfd_reloc_code_real_type code)
{
/* Note that the iq2000_elf_howto_table is indxed by the R_
constants. Thus, the order that the howto records appear in the
Index: bfd/nlmcode.h
===================================================================
RCS file: /cvs/src/src/bfd/nlmcode.h,v
retrieving revision 1.12
diff -u -p -r1.12 nlmcode.h
--- bfd/nlmcode.h 24 Jun 2004 04:46:25 -0000 1.12
+++ bfd/nlmcode.h 19 Nov 2004 11:02:50 -0000
@@ -1692,7 +1692,7 @@ nlm_write_object_contents (abfd)
/* A weak check on whether the section file positions were
reasonable. */
- if (bfd_tell (abfd) > (ufile_ptr) nlm_fixed_header (abfd)->codeImageOffset)
+ if (bfd_tell (abfd) > nlm_fixed_header (abfd)->codeImageOffset)
{
bfd_set_error (bfd_error_invalid_operation);
goto error_return;
--
Alan Modra
IBM OzLabs - Linux Technology Centre
^ permalink raw reply [flat|nested] 3+ messages in thread
* bfd warning fixes
@ 2000-07-09 22:22 Alan Modra
0 siblings, 0 replies; 3+ messages in thread
From: Alan Modra @ 2000-07-09 22:22 UTC (permalink / raw)
To: binutils
I've just checked in some warning fixes from
Ryan Bradetich <rbradetich@uswest.net>
Alan Modra
--
Linuxcare. Support for the Revolution.
bfd/ChangeLog
* dwarf1.c (parse_die): Cure signed/unsigned char warnings.
(parse_line_table): Ditto.
(_bfd_dwarf1_find_nearest_line): Ditto.
* syms.c (cmpindexentry): Remove extra `*' from params.
Index: dwarf1.c
===================================================================
RCS file: /cvs/src/src/bfd/dwarf1.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -p -r1.4 -r1.5
--- dwarf1.c 1999/10/18 12:45:21 1.4
+++ dwarf1.c 2000/07/10 05:14:13 1.5
@@ -1,5 +1,5 @@
/* DWARF 1 find nearest line (_bfd_dwarf1_find_nearest_line).
- Copyright 1998, 1999 Free Software Foundation, Inc.
+ Copyright 1998, 1999, 2000 Free Software Foundation, Inc.
Written by Gavin Romig-Koch of Cygnus Solutions (gavin@cygnus.com).
@@ -184,7 +184,7 @@ parse_die (abfd, aDieInfo, aDiePtr)
memset (aDieInfo,0,sizeof(*aDieInfo));
/* First comes the length. */
- aDieInfo->length = bfd_get_32 (abfd, xptr);
+ aDieInfo->length = bfd_get_32 (abfd, (bfd_byte *) xptr);
xptr += 4;
if (aDieInfo->length == 0)
return false;
@@ -196,7 +196,7 @@ parse_die (abfd, aDieInfo, aDiePtr)
}
/* Then the tag. */
- aDieInfo->tag = bfd_get_16 (abfd, xptr);
+ aDieInfo->tag = bfd_get_16 (abfd, (bfd_byte *) xptr);
xptr += 2;
/* Then the attributes. */
@@ -208,7 +208,7 @@ parse_die (abfd, aDieInfo, aDiePtr)
must handle all dwarf1 forms, but need only handle the
actual attributes that we care about. */
- attr = bfd_get_16 (abfd, xptr);
+ attr = bfd_get_16 (abfd, (bfd_byte *) xptr);
xptr += 2;
switch (FORM_FROM_ATTR (attr))
@@ -219,10 +219,10 @@ parse_die (abfd, aDieInfo, aDiePtr)
case FORM_DATA4:
case FORM_REF:
if (attr == AT_sibling)
- aDieInfo->sibling = bfd_get_32 (abfd, xptr);
+ aDieInfo->sibling = bfd_get_32 (abfd, (bfd_byte *) xptr);
else if (attr == AT_stmt_list)
{
- aDieInfo->stmt_list_offset = bfd_get_32 (abfd, xptr);
+ aDieInfo->stmt_list_offset = bfd_get_32 (abfd, (bfd_byte *) xptr);
aDieInfo->has_stmt_list = 1;
}
xptr += 4;
@@ -232,16 +232,16 @@ parse_die (abfd, aDieInfo, aDiePtr)
break;
case FORM_ADDR:
if (attr == AT_low_pc)
- aDieInfo->low_pc = bfd_get_32 (abfd, xptr);
+ aDieInfo->low_pc = bfd_get_32 (abfd, (bfd_byte *) xptr);
else if (attr == AT_high_pc)
- aDieInfo->high_pc = bfd_get_32 (abfd, xptr);
+ aDieInfo->high_pc = bfd_get_32 (abfd, (bfd_byte *) xptr);
xptr += 4;
break;
case FORM_BLOCK2:
- xptr += 2 + bfd_get_16 (abfd, xptr);
+ xptr += 2 + bfd_get_16 (abfd, (bfd_byte *) xptr);
break;
case FORM_BLOCK4:
- xptr += 4 + bfd_get_32 (abfd, xptr);
+ xptr += 4 + bfd_get_32 (abfd, (bfd_byte *) xptr);
break;
case FORM_STRING:
if (attr == AT_name)
@@ -276,7 +276,7 @@ parse_line_table (stash, aUnit)
return false;
size = bfd_get_section_size_before_reloc (msec);
- stash->line_section = (unsigned char*) bfd_alloc (stash->abfd, size);
+ stash->line_section = (char *) bfd_alloc (stash->abfd, size);
if (! stash->line_section)
return false;
@@ -299,11 +299,11 @@ parse_line_table (stash, aUnit)
unsigned long base;
/* First comes the length. */
- tblend = bfd_get_32 (stash->abfd, xptr) + xptr;
+ tblend = bfd_get_32 (stash->abfd, (bfd_byte *) xptr) + xptr;
xptr += 4;
/* Then the base address for each address in the table. */
- base = bfd_get_32 (stash->abfd, xptr);
+ base = bfd_get_32 (stash->abfd, (bfd_byte *) xptr);
xptr += 4;
/* How many line entrys?
@@ -311,7 +311,7 @@ parse_line_table (stash, aUnit)
aUnit->line_count = (tblend - xptr) / 10;
/* Allocate an array for the entries. */
- aUnit->linenumber_table = (struct linenumber*)
+ aUnit->linenumber_table = (struct linenumber *)
bfd_alloc (stash->abfd,
sizeof (struct linenumber) * aUnit->line_count);
@@ -319,7 +319,7 @@ parse_line_table (stash, aUnit)
{
/* A line number. */
aUnit->linenumber_table[eachLine].linenumber
- = bfd_get_32 (stash->abfd, xptr);
+ = bfd_get_32 (stash->abfd, (bfd_byte *) xptr);
xptr += 4;
/* Skip the position within the line. */
@@ -327,7 +327,7 @@ parse_line_table (stash, aUnit)
/* And finally the address. */
aUnit->linenumber_table[eachLine].addr
- = base + bfd_get_32 (stash->abfd, xptr);
+ = base + bfd_get_32 (stash->abfd, (bfd_byte *) xptr);
xptr += 4;
}
}
@@ -495,7 +495,7 @@ _bfd_dwarf1_find_nearest_line (abfd, sec
}
size = bfd_get_section_size_before_reloc (msec);
- stash->debug_section = (unsigned char*) bfd_alloc (abfd, size);
+ stash->debug_section = (char *) bfd_alloc (abfd, size);
if (! stash->debug_section)
return false;
Index: syms.c
===================================================================
RCS file: /cvs/src/src/bfd/syms.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -p -r1.6 -r1.7
--- syms.c 2000/06/29 15:06:34 1.6
+++ syms.c 2000/07/10 05:14:13 1.7
@@ -1,5 +1,5 @@
/* Generic symbol-table support for the BFD library.
- Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
+ Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
Free Software Foundation, Inc.
Written by Cygnus Support.
@@ -788,8 +788,8 @@ struct indexentry
static int
cmpindexentry (a, b)
- const PTR *a;
- const PTR *b;
+ const PTR a;
+ const PTR b;
{
const struct indexentry *contestantA = (const struct indexentry *) a;
const struct indexentry *contestantB = (const struct indexentry *) b;
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-02-17 12:37 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-17 16:07 bfd warning fixes Alan Modra
-- strict thread matches above, loose matches on Subject: below --
2004-11-19 11:57 Alan Modra
2000-07-09 22:22 Alan Modra
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).