* reloc16.c (bfd_coff_reloc16_relax_section): Count the total number
of shrinks properly, including the last reloc.
This commit is contained in:
parent
751a959bb8
commit
c4d5c859ba
2 changed files with 11 additions and 4 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2000-03-14 Kazu Hirata <kazu@hxi.com>
|
||||||
|
|
||||||
|
* reloc16.c (bfd_coff_reloc16_relax_section): Count the total number
|
||||||
|
of shrinks properly, including the last reloc.
|
||||||
|
|
||||||
2000-03-13 Kazu Hirata <kazu@hxi.com>
|
2000-03-13 Kazu Hirata <kazu@hxi.com>
|
||||||
|
|
||||||
* coff-h8300.c (h8300_reloc16_extra_cases): Fix the sanity
|
* coff-h8300.c (h8300_reloc16_extra_cases): Fix the sanity
|
||||||
|
|
|
@ -195,9 +195,10 @@ bfd_coff_reloc16_relax_section (abfd, i, link_info, again)
|
||||||
{
|
{
|
||||||
int another_pass = 0;
|
int another_pass = 0;
|
||||||
|
|
||||||
/* Allocate and initialize the shrinks array for this section. */
|
/* Allocate and initialize the shrinks array for this section.
|
||||||
shrinks = (int *) bfd_malloc (reloc_count * sizeof (int));
|
The last element is used as an accumlator of shrinks. */
|
||||||
memset (shrinks, 0, reloc_count * sizeof (int));
|
shrinks = (int *) bfd_malloc ((reloc_count + 1) * sizeof (int));
|
||||||
|
memset (shrinks, 0, (reloc_count + 1) * sizeof (int));
|
||||||
|
|
||||||
/* Loop until nothing changes in this section. */
|
/* Loop until nothing changes in this section. */
|
||||||
do {
|
do {
|
||||||
|
@ -219,13 +220,14 @@ bfd_coff_reloc16_relax_section (abfd, i, link_info, again)
|
||||||
if (shrink != shrinks[i])
|
if (shrink != shrinks[i])
|
||||||
{
|
{
|
||||||
another_pass = 1;
|
another_pass = 1;
|
||||||
for (j = i + 1; j < reloc_count; j++)
|
for (j = i + 1; j <= reloc_count; j++)
|
||||||
shrinks[j] += shrink - shrinks[i];
|
shrinks[j] += shrink - shrinks[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} while (another_pass);
|
} while (another_pass);
|
||||||
|
|
||||||
|
shrink = shrinks[reloc_count];
|
||||||
free((char *)shrinks);
|
free((char *)shrinks);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue