2
0
mirror of https://frontier.innolan.net/github/amigaos-binutils.git synced 2025-11-19 19:49:57 +00:00

* (amiga_write_object_contents): Fix HUNK_DEBUG size calculation for 64bit hosts.

The broken code used the wrong structure for the size calculation. This bug was
  hidden on 32bit hosts since both structures have the same size on such hosts.
  The AmigaOS program loader refuses to load programs with a defective structure.
This commit is contained in:
Gunther Nikl
2014-11-27 21:01:50 +00:00
parent c1f1f943e1
commit 11b5fe1b1d

View File

@ -1475,9 +1475,9 @@ amiga_write_object_contents (abfd)
/* Write out HUNK_DEBUG, size, ZMAGIC, ... */
n[0] = HUNK_DEBUG;
n[1] = 3 + ((symbols * sizeof(struct internal_nlist) + str_size + 3) >> 2);
n[1] = 3 + ((symbols * sizeof(struct external_nlist) + str_size + 3) >> 2);
n[2] = ZMAGIC; /* Magic number */
n[3] = symbols * sizeof(struct internal_nlist);
n[3] = symbols * sizeof(struct external_nlist);
n[4] = str_size;
if (!write_longs (n, 5, abfd))
return FALSE;