summaryrefslogtreecommitdiff
path: root/bfd/elf32-ppc.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2003-06-24 06:41:36 +0000
committerMark Mitchell <mark@codesourcery.com>2003-06-24 06:41:36 +0000
commitb2204f2d76347c7aa37259707bcfe99dd32d6ea5 (patch)
tree66cf5f70ea51910571d33002039cde087e587bd6 /bfd/elf32-ppc.c
parentc1218228dd3ebec8d96e06bf986fd6f3b183f12b (diff)
downloadgdb-b2204f2d76347c7aa37259707bcfe99dd32d6ea5.tar.gz
* elf32-ppc.c (ppc_elf_begin_write_processing): Use bytes to count
APUinfo slots. (ppc_elf_final_write_processing): Likewise.
Diffstat (limited to 'bfd/elf32-ppc.c')
-rw-r--r--bfd/elf32-ppc.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index d2cbd836f40..a60015dfb3f 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -5721,9 +5721,9 @@ ppc_elf_begin_write_processing (abfd, link_info)
if (strcmp (ptr + 12, APUINFO_LABEL) != 0)
goto fail;
- /* Get the number of apuinfo entries. */
+ /* Get the number of bytes used for apuinfo entries. */
datum = bfd_get_32 (ibfd, ptr + 4);
- if ((datum * 4 + 20) != length)
+ if (datum + 20 != length)
goto fail;
/* Make sure that we do not run off the end of the section. */
@@ -5731,8 +5731,8 @@ ppc_elf_begin_write_processing (abfd, link_info)
goto fail;
/* Scan the apuinfo section, building a list of apuinfo numbers. */
- for (i = 0; i < datum; i++)
- apuinfo_list_add (bfd_get_32 (ibfd, ptr + 20 + (i * 4)));
+ for (i = 0; i < datum; i += 4)
+ apuinfo_list_add (bfd_get_32 (ibfd, ptr + 20 + i));
/* Update the offset. */
offset += length;
@@ -5808,7 +5808,7 @@ ppc_elf_final_write_processing (abfd, linker)
/* Create the apuinfo header. */
num_entries = apuinfo_list_length ();
bfd_put_32 (abfd, sizeof APUINFO_LABEL, buffer);
- bfd_put_32 (abfd, num_entries, buffer + 4);
+ bfd_put_32 (abfd, num_entries * 4, buffer + 4);
bfd_put_32 (abfd, 0x2, buffer + 8);
strcpy (buffer + 12, APUINFO_LABEL);