[patch] New debug_displays_assert [Re: readelf broken by DWARF-5 patch]
Jan Kratochvil
jkratoch@redhat.com
Thu Mar 2 09:17:00 GMT 2017
Hi Alan,
On Thu, 02 Mar 2017 03:50:05 +0100, Alan Modra wrote:
> Jan, your DWARF-5 patch broke readelf, because new entries were added
> to dwarf.c:debug_displays without making corresponding changes to
> dwarf.h:dwarf_section_display_enum. Please fix.
Is this patch OK for check-in? As binutils still does not use C++ the
static_assert() functionality is copied from gdb_static_assert().
Jan
-------------- next part --------------
binutils/
2017-03-02 Jan Kratochvil <jan.kratochvil@redhat.com>
* dwarf.c (debug_displays_assert): New static assertion.
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index ad0bfcf..fdfbc16 100644
--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -8591,3 +8591,6 @@ struct dwarf_section_display debug_displays[] =
{ { ".debug_tu_index", "", NULL, NULL, 0, 0, 0, NULL, 0, NULL },
display_cu_index, &do_debug_cu_index, FALSE },
};
+
+/* A static assertion. */
+extern int debug_displays_assert[ARRAY_SIZE (debug_displays) == max ? 1 : -1];
More information about the Binutils
mailing list