Hi Eric,

> I have one of those bugs from hell that comes and goes without any 
> discernable pattern
> to its cause, so I'm looking for assistance as to where I should start for 
> troubleshooting.

If the bug is reproducible with a given set of object files and linker 
command line, then you could open a binutils bug report here:


Also, it would be worth downloading and building a linker from the 
current mainline FSF binutils sources.  That linker should be backwards 
compatible with the one from the TI release, and it may, possibly, 
contain a bug fix which solves the problem.

> msp430-elf/bin/ld: BFD (GNU Binutils) internal error, 
> aborting at ../../bfd/elf-eh-frame.c line 1726 in 
> _bfd_elf_write_section_eh_frame

> Looking at the binutils source, this is failing at:
>    /* 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
>       size_of_output_cie_fde.  */
>    if ((sec->size % ptr_size) != 0)
>      abort ();

> So a section is getting generated with improperly alignment I'm guessing?

Yes, that would appear to be the case.

> Is there any
> tool I could use to ascertain this - I know the compiler is building all the 
> .o files,
> and it's just bombing on linking, so can msp430-elf-objdump be used to 
> somehow spot the
> "odd-sized section"?


    msp430-elf-objdump -h foo.o

should show you all the sections in foo.o.  You could also use readelf 
to perform the same task, as in:

   msp430-elf-readelf -S foo.o

> I would provide more detail but the source is a bit large and the bug rather 
> ... random (yet
> repeatable), so I'm mostly looking for expert advice on how I can dig deeper 
> and hopefully
> spot the bug myself.

I would suggest that you add a printf before the abort that prints out 
the name of the section (sec->name) and the size, and just to be 
paranoid, the value of ptr_size.  That will help narrow down which 
section(s) is causing the problem.

I also see that in the current mainline sources have this patch:

   2014-11-11  Alan Modra  <amo...@gmail.com>

        * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Adjust section
        size check to account for possible zero terminator.

which may well address the problem that you have encountered.  Details 
of the patch can be found here:



Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
Mspgcc-users mailing list

Reply via email to