BFD bug in msp430-elf-gcc 4.9.3 (stock and TI source release 3_04_05_00)
I've encountered another BFD problem, similar to the one reported by Eric a
few months back (2015-03-25 13:43:23).
I am currently using GCC 4.9.3 and binutils 2.25.1 on a gentoo machine
(which include the fix by Alan Modra), and I'm getting the following error:
/usr/libexec/gcc/msp430-elf/ld: BFD (Gentoo 2.25.1 p1.0) 2.25.1 internal
error, aborting at
line 1732 in _bfd_elf_write_section_eh_frame
Here is the code snippet:
/* We don't align the section to its section alignment since the
runtime library only expects all CIE/FDE records aligned at
the pointer size. _bfd_elf_discard_section_eh_frame should
have padded CIE/FDE records to multiple of pointer size with
sec_size = sec->size;
if (sec_info->count != 0
&& sec_info->entry[sec_info->count - 1].size == 4)
sec_size -= 4;
if ((sec_size % ptr_size) != 0)
abort (); */* this is line 1732 */*
I've narrowed it down to an [.eh_frame] in one of the object files, which
has a size of 74 (0x4a) while ptr_size is 4.
The issue is the the MSP430 has two different sizes for its pointers,
depending upon whether large mode has been enabled or not, but the BFD
library was assuming that pointers were always 4 bytes long...
Re: BFD bug in msp430-elf-gcc 4.9.3 (stock and TI source release 3_04_05_00)
Please could you try the patch found in this email (and copied here for
> ease of access):
> https://www.sourceware.org/ml/binutils/2015-07/msg00319.html >
> The issue is the the MSP430 has two different sizes for its pointers,
> depending upon whether large mode has been enabled or not, but the BFD
> library was assuming that pointers were always 4 bytes long...
I've applied the patch to the stock binutils and it works now!
I'll try the TI/RH sources next.
I hope this gets into the next release and picked up by Gentoo soon :-)