2
0
mirror of https://github.com/bebbo/amigaos-binutils-2.14.git synced 2025-12-08 22:08:25 +00:00

Unify relocation read logic.

* bfd/amigaos.c (read_raw_relocs): Replace switch with an if test.
This commit is contained in:
Gunther Nikl
2015-04-29 18:48:43 +00:00
parent 48a6d2ca95
commit f723c5d6ef

View File

@ -2619,30 +2619,9 @@ read_raw_relocs (abfd, section, d_offset, count)
return FALSE;
}
switch (type)
{
case HUNK_RELOC32SHORT:
/* read reloc count, hunk number and offsets */
for (;;) {
/* read offsets and hunk number */
if (!get_word (abfd, &no))
return FALSE;
if (!no)
break;
count -= no;
if (!get_word (abfd, &hunk_number))
return FALSE;
/* add relocs */
for (j=0; j<no; j++) {
if (!get_word (abfd, &offset) ||
!amiga_add_reloc (abfd, section, offset, NULL, howto,
hunk_number))
return FALSE;
}
}
break;
default:
if (howto->type != H_ABS32SHORT)
{
for (;;) {
/* read offsets and hunk number */
if (!get_long (abfd, &no))
@ -2657,10 +2636,29 @@ read_raw_relocs (abfd, section, d_offset, count)
if (!get_long (abfd, &offset) ||
!amiga_add_reloc (abfd, section, offset, NULL, howto,
hunk_number))
return FALSE;
}
}
}
else
{
for (;;) {
/* read offsets and hunk number */
if (!get_word (abfd, &no))
return FALSE;
if (!no)
break;
count -= no;
if (!get_word (abfd, &hunk_number))
return FALSE;
/* add relocs */
for (j=0; j<no; j++) {
if (!get_word (abfd, &offset) ||
!amiga_add_reloc (abfd, section, offset, NULL, howto,
hunk_number))
return FALSE;
}
}
break;
}
}