This is the mail archive of the
mailing list for the binutils project.
Re: Bug in STM32L4XX patch
- From: Laurent Alfonsi <laurent dot alfonsi at st dot com>
- To: Nick Clifton <nickc at redhat dot com>
- Cc: Christophe MONAT <christophe dot monat at st dot com>, "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Thu, 29 Oct 2015 16:44:21 +0100
- Subject: Re: Bug in STM32L4XX patch
- Authentication-results: sourceware.org; auth=none
- References: <87d1vzxdz2 dot fsf at redhat dot com>
On 10/28/15 15:30, Nick Clifton wrote:
Hi Laurent, Hi Christophe,
Oops - I forgot to check you recent patch add support for fixing up
the STM32L4XX erratum on a 32-bit host. When I did that this morning,
I found that it did not compile, because you have some casts between
pointers and bfd_vma types. For example:
bfd/elf32-arm.c: In function 'elf32_arm_write_section':
bfd/elf32-arm.c:17032:6: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
((void *) stm32l4xx_errnode->vma-4,
Since it was my oversight in not testing this sceanario, I have taken
the liberty of generating a patch to fix the problem. Hence I am
going to check in the patch below. I hope that you are OK with this.
Ok. Thanks for this change.
However, I don't understand why the "void*" has a different type size
than bfd_vma (eq. "unsigned long"). I thought these types had the same
size on both 32-bit and 64-bit hosts.
Concerning the types defined in the bfd we noticed also another type
that is misleading.
But we didn't want to propose any change along with this patch.
Thus, the insn32 is currently defined in elf23-arm.c as "typedef
unsigned long int insn32"
Which means that, for a 64-bit host, it is defined as a 64-bit type.
I can see from the log, that this is pretty old, but this could bring to