2011-08-01 Tristan Gingold <gingold@adacore.com>

* write.c (write_relocs): Fix -Wshadow in DEBUG3 and DEBUG4.
This commit is contained in:
Tristan Gingold 2011-08-01 09:05:40 +00:00
parent 8d8385cfb8
commit 1596988d53
2 changed files with 15 additions and 11 deletions

View File

@ -1,3 +1,7 @@
2011-08-01 Tristan Gingold <gingold@adacore.com>
* write.c (write_relocs): Fix -Wshadow in DEBUG3 and DEBUG4.
2011-08-01 Tristan Gingold <gingold@adacore.com> 2011-08-01 Tristan Gingold <gingold@adacore.com>
* frags.c (frag_grow): Simplify the code. * frags.c (frag_grow): Simplify the code.

View File

@ -1233,15 +1233,15 @@ write_relocs (bfd *abfd, asection *sec, void *xxx ATTRIBUTE_UNUSED)
#ifdef DEBUG4 #ifdef DEBUG4
{ {
unsigned int i, j, nsyms; unsigned int k, j, nsyms;
asymbol **sympp; asymbol **sympp;
sympp = bfd_get_outsymbols (stdoutput); sympp = bfd_get_outsymbols (stdoutput);
nsyms = bfd_get_symcount (stdoutput); nsyms = bfd_get_symcount (stdoutput);
for (i = 0; i < n; i++) for (k = 0; k < n; k++)
if (((*relocs[i]->sym_ptr_ptr)->flags & BSF_SECTION_SYM) == 0) if (((*relocs[k]->sym_ptr_ptr)->flags & BSF_SECTION_SYM) == 0)
{ {
for (j = 0; j < nsyms; j++) for (j = 0; j < nsyms; j++)
if (sympp[j] == *relocs[i]->sym_ptr_ptr) if (sympp[j] == *relocs[k]->sym_ptr_ptr)
break; break;
if (j == nsyms) if (j == nsyms)
abort (); abort ();
@ -1280,16 +1280,16 @@ write_relocs (bfd *abfd, asection *sec, void *xxx ATTRIBUTE_UNUSED)
#ifdef DEBUG3 #ifdef DEBUG3
{ {
unsigned int i; unsigned int k;
arelent *r;
asymbol *s;
fprintf (stderr, "relocs for sec %s\n", sec->name); fprintf (stderr, "relocs for sec %s\n", sec->name);
for (i = 0; i < n; i++) for (k = 0; k < n; k++)
{ {
r = relocs[i]; arelent *rel = relocs[k];
s = *r->sym_ptr_ptr; asymbol *s = *rel->sym_ptr_ptr;
fprintf (stderr, " reloc %2d @%p off %4lx : sym %-10s addend %lx\n", fprintf (stderr, " reloc %2d @%p off %4lx : sym %-10s addend %lx\n",
i, r, (unsigned long)r->address, s->name, (unsigned long)r->addend); k, rel, (unsigned long)rel->address, s->name,
(unsigned long)rel->addend);
} }
} }
#endif #endif