open-watcom / open-watcom-v2

Open Watcom V2.0 - Source code repository, Wiki, Latest Binary build, Archived builds including all installers for download.
Other
963 stars 157 forks source link

readelf complains about dwarf debug sections #1042

Open OPNA2608 opened 1 year ago

OPNA2608 commented 1 year ago

(commit 996740acdbb173499ec1bf2ba6c8942f2a374220)

Compiling some basic code (obviously bad to check debuggability) with dwarf debug symbols for Linux produces a binary that readelf (from binutils) isn't quite happy with.

/* test.c */
#include <stdio.h>

int main (void) {
        unsigned char c = 0;

        do {
                printf ("c: %hhu\n", c);
                c += 1;
                if (c == 42) {
                        *(unsigned long int*)(c) = 0xdeadbeef;
                }
        } while (c != 0);

        return 0;
}
$ wcl386 -hd -d2 -fe=owv2_dwarf test.c
# ...

$ readelf --debug-dump=info owv2_dwarf 2>&1 | grep 'readelf:'
readelf: Error: .debug_abbrev section not zero terminated
readelf: Warning: Bogus end-of-siblings marker detected at offset 13a in .debug_info section
jmalak commented 1 year ago

Thanks for your bug report.