From 5f128a25f235195d1970ec07aec57004dfb90237 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Tue, 9 Feb 2021 15:37:24 +0100 Subject: [PATCH] [binutils] Handle DW_FORM_ref_sig8 in get_type_abbrev_from_form When compiling an exec like this: ... $ gcc -fdebug-types-section hello.c -gdwarf-5 ... we run into: ... $ readelf -w a.out > READELF readelf: Warning: Unexpected form 20 encountered whilst finding \ abbreviation for type ... Fix this by handling DW_FORM_ref_sig8 conservatively in get_type_abbrev_from_form. binutils/ChangeLog: 2021-02-09 Tom de Vries PR binutils/27370 * dwarf.c (get_type_abbrev_from_form): Handle DW_FORM_ref_sig8. --- binutils/ChangeLog | 5 +++++ binutils/dwarf.c | 1 + 2 files changed, 6 insertions(+) diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 0f07cd42eaf..0e59683d422 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,8 @@ +2021-02-09 Tom de Vries + + PR binutils/27370 + * dwarf.c (get_type_abbrev_from_form): Handle DW_FORM_ref_sig8. + 2021-02-09 Tom de Vries PR binutils/27386 diff --git a/binutils/dwarf.c b/binutils/dwarf.c index 6797dd158d6..d6eb8926dbf 100644 --- a/binutils/dwarf.c +++ b/binutils/dwarf.c @@ -2117,6 +2117,7 @@ get_type_abbrev_from_form (unsigned long form, switch (form) { case DW_FORM_GNU_ref_alt: + case DW_FORM_ref_sig8: /* FIXME: We are unable to handle this form at the moment. */ return NULL; -- 2.30.2