mirror of
https://frontier.innolan.net/github/amigaos-binutils.git
synced 2025-11-23 22:42:14 +00:00
Fix RELRELOC32 reading and decoding. AmigaOS 3.x expects short data.
* bfd/amigaos.c (parse_archive_units): Add support for HUNK_RELOC32SHORT. Parse HUNK_RELRELOC32 the same way. (amiga_handle_rest): Check for HUNK_RELRELOC32 when reading short data. (read_raw_relocs): Likewise.
This commit is contained in:
@ -602,7 +602,6 @@ parse_archive_units (abfd, n_units, filesize, one, syms, symcount)
|
|||||||
case HUNK_DREL32:
|
case HUNK_DREL32:
|
||||||
case HUNK_DREL16:
|
case HUNK_DREL16:
|
||||||
case HUNK_DREL8:
|
case HUNK_DREL8:
|
||||||
case HUNK_RELRELOC32:
|
|
||||||
case HUNK_ABSRELOC16:
|
case HUNK_ABSRELOC16:
|
||||||
case HUNK_RELRELOC26:
|
case HUNK_RELRELOC26:
|
||||||
for (;;) {
|
for (;;) {
|
||||||
@ -616,6 +615,21 @@ parse_archive_units (abfd, n_units, filesize, one, syms, symcount)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case HUNK_RELOC32SHORT:
|
||||||
|
case HUNK_RELRELOC32:
|
||||||
|
for (;;) {
|
||||||
|
/* read offsets count */
|
||||||
|
if (!get_word (abfd, &no))
|
||||||
|
return FALSE;
|
||||||
|
if (!no)
|
||||||
|
break;
|
||||||
|
/* skip hunk+offsets */
|
||||||
|
if (bfd_seek (abfd, (no+1)<<1, SEEK_CUR))
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
if ((bfd_tell (abfd) & 2) && bfd_seek (abfd, 2, SEEK_CUR))
|
||||||
|
return FALSE;
|
||||||
|
break;
|
||||||
case HUNK_EXT:
|
case HUNK_EXT:
|
||||||
defsym_pos = 0;
|
defsym_pos = 0;
|
||||||
if (!get_long (abfd, &n))
|
if (!get_long (abfd, &n))
|
||||||
@ -1126,7 +1140,7 @@ amiga_handle_rest (abfd, current_section, isload)
|
|||||||
asect->relocs = relp;
|
asect->relocs = relp;
|
||||||
relp->pos = bfd_tell (abfd) - 4;
|
relp->pos = bfd_tell (abfd) - 4;
|
||||||
relp->num = 0;
|
relp->num = 0;
|
||||||
if (hunk_value != HUNK_RELOC32SHORT) {
|
if (hunk_value != HUNK_RELOC32SHORT && hunk_value != HUNK_RELRELOC32) {
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if (!get_long (abfd, &no))
|
if (!get_long (abfd, &no))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -2624,7 +2638,7 @@ read_raw_relocs (abfd, section, d_offset, count)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* read reloc count, hunk number and offsets */
|
/* read reloc count, hunk number and offsets */
|
||||||
if (howto->type != H_ABS32SHORT)
|
if (type != HUNK_RELOC32SHORT && type != HUNK_RELRELOC32)
|
||||||
{
|
{
|
||||||
for (;;) {
|
for (;;) {
|
||||||
/* read offsets and hunk number */
|
/* read offsets and hunk number */
|
||||||
|
|||||||
Reference in New Issue
Block a user