When running on 32-bit machines, objdump displays an out of range error like:
arm-none-eabi-objcopy: f4b.hex 64-bit address 0x4a2a7708000000 out of range for Intel Hex file
The problem was first reported at:
It affects both Windows and Linux 32-bit builds; 64-bit builds seem ok.
The 'arm-none-eabi-objcopy --version' is 22.214.171.12481213, packed with GCC 8.2.1 by Arm and also by GNU MCU Eclipse.
An earlier build of 8.2.0 running on a 32-bit Arch Linux was ok. It showed version 2.31.1.
Confirmed, this is caused by the change for PR/23699, the code assumes that bfd_vma is always a 64bit value, but it's host dependent.
The result is that on a 32bit system, it always thinks the top bits are set as the top mask bits are gone.
The master branch has been updated by Alan Modra <firstname.lastname@example.org>:
Author: Alan Modra <email@example.com>
Date: Tue Jan 8 22:21:57 2019 +1030
PR24065, 32-bit objcopy fails with 64-bit address ... out of range
* ihex.c (ihex_write_object_contents): Properly check 32-bit
The master branch has been updated by Tamar Christina <firstname.lastname@example.org>:
Author: Tamar Christina <email@example.com>
Date: Tue Jan 8 14:52:53 2019 +0000
Add testcase for PR/24065.
This adds a new testcase for objcopy -O ihex to test
that it correctly works.
* testsuite/binutils-all/copy-6.d: New test.
* testsuite/binutils-all/objcopy.exp: Use it.
fixed in master.
Thank you, Christina, thank you, Alan.
Since the GNU MCU Eclipse GCC distribution usually follows the Arm distributions, I'll talk to them and, depending on their release plans, I'll either wait for them to get this patch or make a custom GNU MCU Eclipse GCC release.
I'll confirm that the bug was fixed as soon as I'll be able to build my release; Arm may equally confirm it, if they proceed with their release sooner.
Arm replied, but currently they have no ETE for a maintenance release.
In the mean time those interrested on a fixed toolchain can use the GNU MCU Eclipse binaries:
To avoid any compatibility issues, I used exactly the same sources, but applied the binutils patch.