bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/21524] Assert on ld.bfd with -r and --gc-sections


From: nickc at redhat dot com
Subject: [Bug ld/21524] Assert on ld.bfd with -r and --gc-sections
Date: Tue, 13 Jun 2017 13:23:26 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=21524

--- Comment #7 from Nick Clifton <nickc at redhat dot com> ---
Hi Adhemerval,

  I think that this bug is symptomatic of a larger problem - when the linker
runs garbage collection it does not remove the debug information connected to
the sections that it decides to discard.  In this particular case the debug
information concerned contains a relocation that references a symbol in the
discarded section.  This then triggers the abort in the linker when it detects
that it is about to write out a relocation that can no longer be processed
properly.

  I have checked in a patch to replace the call to abort with an informative
error message, and an error result from the link.  This should help future
users who encounter this same problem.  It does not resolve the bigger problem
however - that of removing the redundant debug information.

  There is a solution to the problem, although it requires an enhancement to
both the compiler and the linker.  If the compiler were to generate a section
group containing both the compiled code/data and its associated debug
information, then the linker garbage collector could discard the entire group
when it finds that the code/data is no longer needed.  It just needs a
motivated developer to decide that the idea is worth implementing...

Cheers
  Nick

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]