Currently not supported:
$ gcc -gdwarf-5 ../src/testsuite/dwz.tests/hello.c
$ gdb-add-index -dwarf-5 a.out
$ cp a.out 1; ./dwz 1
./dwz: 1: Unknown debugging section .debug_names
This will need coordination with the rest of the GNU Toolchain, in particular GDB, which uses .gdb_index (which dwz does support). The .debug_names that gdb-add-index -dwarf-5 generates seems incomplete (https://www.sourceware.org/bugzilla/show_bug.cgi?id=24820) and it might need some extensions (in DWARF6?) to be generated properly.