From 11b5fe1b1df79acffe5667ec01a5a4191c7a72c2 Mon Sep 17 00:00:00 2001 From: Gunther Nikl Date: Thu, 27 Nov 2014 21:01:50 +0000 Subject: [PATCH] * (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. --- bfd/amigaos.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bfd/amigaos.c b/bfd/amigaos.c index 5a90253..7a5d469 100644 --- a/bfd/amigaos.c +++ b/bfd/amigaos.c @@ -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;