[PATCH] tests: fix for toolchains producing compressed debug sections

Dmitry V. Levin ldv@altlinux.org
Mon Mar 22 20:00:00 GMT 2021


When toolchain produces compressed debug sections by default,
quite a few debugedit tests fail because of unexpected
"debugedit: ./foo.o: DWARF version 0 unhandled" error diagnostic messages:
  3: debugedit .debug_str objects DWARF4             FAILED (debugedit.at:97)
  4: debugedit .debug_str/line_str objects DWARF5    FAILED (debugedit.at:129)
  9: debugedit .debug_info objects                   FAILED (debugedit.at:291)
 12: debugedit .debug_types objects                  FAILED (debugedit.at:370)
 15: debugedit .debug_line objects DWARF4            FAILED (debugedit.at:460)
 16: debugedit .debug_line objects DWARF5            FAILED (debugedit.at:484)
 21: debugedit .debug_macro objects                  FAILED (debugedit.at:598)

Fix this by instructing gcc not to produce compressed debug sections
in object files prepared for debugedit tests.

* tests/debugedit.at: Add "-gz=none" to "gcc -g3" invocations.

Co-authored-by: Vitaly Chikunov <vt@altlinux.org>
---
 tests/debugedit.at | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/debugedit.at b/tests/debugedit.at
index fb55574..2d1870b 100644
--- a/tests/debugedit.at
+++ b/tests/debugedit.at
@@ -37,11 +37,11 @@ cp "${abs_srcdir}"/data/SOURCES/foobar.h subdir_headers
 cp "${abs_srcdir}"/data/SOURCES/baz.c .
 
 # First three object files (foo.o subdir_bar/bar.o and baz.o)
-gcc -g3 -Isubdir_headers $1 -c subdir_foo/foo.c
+gcc -g3 -gz=none -Isubdir_headers $1 -c subdir_foo/foo.c
 cd subdir_bar
-gcc -g3 -I../subdir_headers $1 -c bar.c
+gcc -g3 -gz=none -I../subdir_headers $1 -c bar.c
 cd ..
-gcc -g3 -I$(pwd)/subdir_headers $1 -c $(pwd)/baz.c
+gcc -g3 -gz=none -I$(pwd)/subdir_headers $1 -c $(pwd)/baz.c
 
 # Then a partially linked object file (somewhat like a kernel module).
 # This will still have relocations between the debug sections.
@@ -49,7 +49,7 @@ ld -r -o foobarbaz.part.o foo.o subdir_bar/bar.o baz.o
 
 # Create an executable. Relocations between debug sections will
 # have been resolved.
-gcc -g3 -o foobarbaz.exe foo.o subdir_bar/bar.o baz.o
+gcc -g3 -gz=none -o foobarbaz.exe foo.o subdir_bar/bar.o baz.o
 ]])
 
 # ===
-- 
ldv


More information about the Debugedit mailing list