This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Bad xtensa assumption in BFD
- From: "H. J. Lu" <hjl at lucon dot org>
- To: bob dot wilson at acm dot org
- Cc: binutils at sources dot redhat dot com
- Date: Wed, 15 Oct 2003 10:30:44 -0700
- Subject: Bad xtensa assumption in BFD
Hi Bob,
xtensa uses
typedef struct property_table_entry_t
{
bfd_vma address;
bfd_vma size;
} property_table_entry;
for both internal and external representations. It doesn't work with
--enable-64-bit-bfd where bfd_vma is 64bit. This patch seems to work
for me. Can you look into it?
Thanks.
H.J.
----
2003-10-15 H.J. Lu <hongjiu.lu@intel.com>
* elf32-xtensa.c (xtensa_read_table_entries): The external size
of entry is 8 bytes.
--- bfd/elf32-xtensa.c.free 2003-10-14 17:19:56.000000000 -0700
+++ bfd/elf32-xtensa.c 2003-10-15 10:26:24.000000000 -0700
@@ -514,7 +514,7 @@ xtensa_read_table_entries (abfd, section
return 0;
}
- num_records = table_size / sizeof (property_table_entry);
+ num_records = table_size / 8;
table_data = retrieve_contents (abfd, table_section, TRUE);
blocks = (property_table_entry *)
bfd_malloc (num_records * sizeof (property_table_entry));
@@ -556,7 +556,7 @@ xtensa_read_table_entries (abfd, section
and the addresses are already in the table. */
bfd_vma off;
- for (off = 0; off < table_size; off += sizeof (property_table_entry))
+ for (off = 0; off < table_size; off += 8)
{
bfd_vma address = bfd_get_32 (abfd, table_data + off);