[LD, ARM] Fix in STM32L4XX patch
Christophe Lyon
christophe.lyon@linaro.org
Fri Nov 6 15:51:00 GMT 2015
Hi,
While running the linker tests on a 32-bits i686 host with
enable-64-bit-bfd=yes, I noticed that a test of the STM32L4XX patch
was failing.
This is because it expects a message containing an out-of-range
offset, and does not print the right value: the print format contains
%d while the value is of type long long.
The attached small patch fixes that by forcing %ld and casting the
value to (long), as it seems to be standard practice elsewhere in the
binutils, although not very clean.
Nick, don't you see this error?
OK?
Christophe.
-------------- next part --------------
2015-11-06 Christophe Lyon <christophe.lyon@linaro.org>
bfd/
* elf32-arm.c (elf32_arm_write_section): Force offset output as
long (%ld).
-------------- next part --------------
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index fd4f743..4764523 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -17010,10 +17010,10 @@ elf32_arm_write_section (bfd *output_bfd,
(*_bfd_error_handler)
(_("%B(%#x): error: Cannot create STM32L4XX veneer. "
- "Jump out of range by %d bytes. "
+ "Jump out of range by %ld bytes. "
"Cannot encode branch instruction. "),
output_bfd,
- stm32l4xx_errnode->vma - 4,
+ (long)stm32l4xx_errnode->vma - 4,
out_of_range);
continue;
}
More information about the Binutils
mailing list