binutils: backport DWARF-5 support for gold

* DWARF-5 is now used by default with gcc-11, causing
  11.1.0/ld: internal error in format_file_lineno, at ../../gold/dwarf_reader.cc:2278
  collect2: error: ld returned 1 exit status
  in various projects (runc-opencontainers, libhybris, collada-dom)

* https://gcc.gnu.org/gcc-11/changes.html

  For targets that produce DWARF debugging information GCC now defaults to DWARF version 5
  (with the exception of VxWorks and Darwin/Mac OS X which default to version 2 and
  AIX which defaults to version 4). This can produce up to 25% more compact debug
  information compared to earlier versions.

  To take full advantage of DWARF version 5 GCC needs to be build against binutils version 2.35.2 or higher.
  When GCC is build against earlier versions of binutils GCC will still emit DWARF version 5 for
  most debuginfo data, but will generate version 4 debug line tables (even when explicitly given -gdwarf-5).

  The following debug information consumers can process DWARF version 5:

  GDB 8.0, or higher
  valgrind 3.17.0
  elfutils 0.172, or higher (for use with systemtap, dwarves/pahole, perf and libabigail)
  dwz 0.14
  Programs embedding libbacktrace are urged to upgrade to the version shipping with GCC 11.

  To make GCC 11 generate an older DWARF version use -g together with -gdwarf-2, -gdwarf-3 or -gdwarf-4.

(From OE-Core rev: d07d4d739ae17787017f771dd2068fda0e836722)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Martin Jansa
2021-05-12 18:45:03 +02:00
committed by Richard Purdie
parent 0fc0804e4b
commit e7ce28c8b0
2 changed files with 1375 additions and 0 deletions

View File

@@ -36,6 +36,7 @@ SRC_URI = "\
file://0015-sync-with-OE-libtool-changes.patch \
file://0016-Check-for-clang-before-checking-gcc-version.patch \
file://0017-Add-support-for-the-DW_FORM_strx-forms-to-the-BFD-li.patch \
file://0018-Add-DWARF-5-support-in-gold.patch \
file://CVE-2021-20197.patch \
"
S = "${WORKDIR}/git"

File diff suppressed because it is too large Load Diff