This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Bad xtensa assumption in BFD


Your patch looks fine.

I noticed that you already applied the patch.  Did someone approve it?  I 
don't see any approval messages on the binutils list.  I'm sorry that I 
didn't get a chance to investigate this until today, but I was surprised to 
see that you went ahead and applied it anyway.

On Wednesday 15 October 2003 10:30, H. J. Lu wrote:
> 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);

-- 
Bob Wilson                      Tel: (408) 327-7312
Tensilica, Inc.                 Fax: (408) 986-8919
3255-6 Scott Blvd.              email: bwilson@tensilica.com
Santa Clara, CA 95054


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]