[fpc-devel] BFD (GNU Binutils) 2.23.1 assertion fail elf32-arm.c:12328

Bruce Tulloch pascal at causal.com
Sat May 25 02:57:08 CEST 2013

Next step in my ARM cross compilation journey...this error...

It's produced by arm-linux.ld which I've built from binutils upstream
source (2.23.1) and am using for cross compiling using FPC 2.7.1.

It occurs when building a large project so I've not identified what may
be triggering it yet. The relevant part of the ld source is:

      if (may_need_local_target_p
      && elf32_arm_get_plt_info (abfd, eh, r_symndx, &root_plt, &arm_plt))
      /* If PLT refcount book-keeping is wrong and too low, we'll
         see a zero value (going to -1) for the root PLT reference
         count.  */
      if (root_plt->refcount >= 0)
          BFD_ASSERT (root_plt->refcount != 0);
          root_plt->refcount -= 1;

which says the procedure linkage table reference count is already
zero when it should not be.

An apparently relevant discussion about it is here:


according to which, this assert arises in arm-linux-gnueabi when:

    - There's a reference (call-reloc) to a symbol undefined at first
    reference, preliminary requiring a PLT.

    - The symbols' definition is found in the linked objects and is
    hidden (or forced local).

    - The referencing section (containing the call-reloc) is GC'd
    (its global symbols are forced local by the version script and
    found to be unused).

    Then, the gc_sweep function tries to balance the books by -= 1
    on the now-GC'd-away PLT (with refcount set to -1 from the
    already forced-local symbol) which is guarded by a "BFD_ASSERT
    (root_plt->refcount > 0)". So the assert strikes.

I will try to isolate what part of my build triggers this but I thought
I'd post details in case anyone more familiar with GNU linking on
ARM can suggest anything.


More information about the fpc-devel mailing list