This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[committed] BFD warning fixes for SOM arch
- From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- To: binutils at sources dot redhat dot com
- Date: Thu, 22 Apr 2004 19:21:12 -0400 (EDT)
- Subject: [committed] BFD warning fixes for SOM arch
The following patch fixes a few warnings building bfd for som.
Aside from aborting for the two unsupported selectors, there shouldn't
be any functional change.
Tested on hppa2.0w-hp-hpux11.11 and hppa1.1-hp-hpux10.20.
Dave
--
J. David Anglin dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6602)
2004-04-22 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
* hpux-core.c (hpux_core_core_file_p): Add cast in call to
make_bfd_asection.
* som.c (som_set_section_contents): Constantify second argument.
(hppa_som_gen_reloc_type): Abort for unsupported selectors.
(som_object_setup): Rework to avoid warning.
(setup_sections, som_write_fixups, bfd_section_from_som_symbol):
Likewise.
Index: hpux-core.c
===================================================================
RCS file: /cvs/src/src/bfd/hpux-core.c,v
retrieving revision 1.11
diff -u -3 -p -r1.11 hpux-core.c
--- hpux-core.c 15 Mar 2004 14:21:42 -0000 1.11
+++ hpux-core.c 22 Apr 2004 22:27:01 -0000
@@ -276,7 +276,8 @@ hpux_core_core_file_p (abfd)
case CORE_ANON_SHMEM:
if (!make_bfd_asection (abfd, ".data",
SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS,
- core_header.len, core_header.addr, 2))
+ core_header.len,
+ (bfd_vma) core_header.addr, 2))
goto fail;
bfd_seek (abfd, (file_ptr) core_header.len, SEEK_CUR);
Index: som.c
===================================================================
RCS file: /cvs/src/src/bfd/som.c,v
retrieving revision 1.38
diff -u -3 -p -r1.38 som.c
--- som.c 30 Nov 2003 18:40:41 -0000 1.38
+++ som.c 22 Apr 2004 22:27:03 -0000
@@ -194,7 +194,7 @@ static bfd_boolean som_bfd_copy_private_
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));
+ PARAMS ((bfd *, sec_ptr, const 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
@@ -1589,6 +1589,11 @@ hppa_som_gen_reloc_type (abfd, base_type
final_types[3] = NULL;
*final_type = base_type;
break;
+
+ /* FIXME: These two field selectors are not currently supported. */
+ case e_ltpsel:
+ case e_rtpsel:
+ abort ();
}
switch (base_type)
@@ -1820,10 +1825,13 @@ som_object_setup (abfd, file_hdrp, aux_h
found = 0;
for (section = abfd->sections; section; section = section->next)
{
+ bfd_vma entry;
+
if ((section->flags & SEC_CODE) == 0)
continue;
- if (aux_hdrp->exec_entry >= section->vma
- && aux_hdrp->exec_entry < section->vma + section->_cooked_size)
+ entry = aux_hdrp->exec_entry;
+ if (entry >= section->vma
+ && entry < section->vma + section->_cooked_size)
found = 1;
}
if (aux_hdrp->exec_entry == 0
@@ -1898,7 +1906,7 @@ setup_sections (abfd, file_hdr, current_
{
struct space_dictionary_record space;
struct subspace_dictionary_record subspace, save_subspace;
- int subspace_index;
+ unsigned int subspace_index;
asection *space_asect;
char *newname;
@@ -2725,7 +2733,7 @@ som_write_fixups (abfd, current_offset,
int reloc_offset;
unsigned int current_rounding_mode;
#ifndef NO_PCREL_MODES
- int current_call_mode;
+ unsigned int current_call_mode;
#endif
/* Find a subspace of this space. */
@@ -4298,7 +4306,7 @@ bfd_section_from_som_symbol (abfd, symbo
&& symbol->symbol_type != ST_SEC_PROG
&& symbol->symbol_type != ST_MILLICODE))
{
- unsigned int index = symbol->symbol_info;
+ int index = symbol->symbol_info;
for (section = abfd->sections; section != NULL; section = section->next)
if (section->target_index == index && som_is_subspace (section))
return section;
@@ -5358,7 +5366,7 @@ static bfd_boolean
som_set_section_contents (abfd, section, location, offset, count)
bfd *abfd;
sec_ptr section;
- PTR location;
+ const PTR location;
file_ptr offset;
bfd_size_type count;
{
@@ -5385,7 +5393,7 @@ som_set_section_contents (abfd, section,
if (bfd_seek (abfd, offset, SEEK_SET) != 0)
return FALSE;
- if (bfd_bwrite ((PTR) location, count, abfd) != count)
+ if (bfd_bwrite (location, count, abfd) != count)
return FALSE;
return TRUE;
}