= Suspicious Debuginfo Cases = DwarfLint discovered a couple interesting cases that need to be investigated and either tracked down to a bug in our toolchain, or a bug in dwarflint. The following happens /a lot/. Each of the following messages is just a sample of a much larger set of messages. The output has around 300K lines total right now. openoffice.org-debuginfo-3.0.1-14.3.fc11.x86_64/usr/lib/debug/usr/lib64/openoffice.org/basis3.0/program/libsclx.so.debug {{{ $ ~/elfutils/build/src/dwarflint --strict libsclx.so.debug warning: .debug_abbrev: 0x124993..0x124993: unnecessary padding with zero bytes. Another file (darkice-debuginfo-0.19-3.fc11.i386:usr:lib:debug:usr:bin:darkice.debug/darkice.debug): warning: .debug_abbrev: 0x76a8..0x76a9: unnecessary padding with zero bytes. warning: .debug_abbrev: 0x81da..0x81da: unnecessary padding with zero bytes. Associated eu-readelf output: ... attr: declaration, form: flag, offset: 0x769d attr: const_value, form: data2, offset: 0x769f Abbreviation section at offset 30376: Abbreviation section at offset 30377: Abbreviation section at offset 30378: [ 1] offset: 30378, children: yes, tag: compile_unit attr: producer, form: strp, offset: 0x76aa attr: language, form: data1, offset: 0x76ac attr: name, form: strp, offset: 0x76ae ... (Padding forms dummy empty section in the DWARF file) }}} {{{ warning: .debug_info: DIE 0x3d9056 (abbr. attribute 0x1020c): caused by this reference. warning: .debug_info: DIE 0x3df566 (abbr. attribute 0x101d2): caused by this reference. error: .debug_ranges: rangelist 0x29e0: the range 0x1ef920..0x1ef92f overlaps with another one. error: .debug_ranges: rangelist 0x29f0: the range 0x1ef930..0x1ef938 overlaps with another one. error: .debug_ranges: rangelist 0x2a00: the range 0x1ef940..0x1ef948 overlaps with another one. warning: .debug_ranges: 0xc720..0xc73f: unnecessary padding with zero bytes. warning: .debug_ranges: 0xc750..0xc76f: unnecessary padding with zero bytes. warning: .debug_ranges: 0xc780..0xc79f: unnecessary padding with zero bytes. warning: .debug_ranges: 0xdbd0..0xdd4f: unreferenced non-zero bytes. warning: .debug_ranges: 0x1e0c0..0x1e0df: unnecessary padding with zero bytes. error: .debug_aranges: addresses 0x1ef830..0x1ef91f of section .text are not covered. error: .debug_aranges: addresses 0x1f5ea6..0x1f5eaf of section .text are not covered. error: .debug_aranges: addresses 0x1f5eba..0x1f5ebf of section .text are not covered. error: .debug_aranges: addresses 0x1f5ece..0x1f5ecf of section .text are not covered. }}} {{{ warning: .debug_loc: loclist 0x32b6b: entry covers no range. warning: .debug_loc: loclist 0x69232: entry covers no range. warning: .debug_loc: loclist 0x69245: entry covers no range. warning: .debug_loc: loclist 0x73795: entry covers no range. }}} {{{ warning: .debug_loc: 0x116d3..0x116fb: unreferenced non-zero bytes. warning: .debug_loc: 0x1170c..0x11731: unreferenced non-zero bytes. warning: .debug_loc: 0x11742..0x11768: unreferenced non-zero bytes. warning: .debug_loc: 0x11779..0x1178b: unreferenced non-zero bytes. error: .debug_loc: addresses 0x1ef830..0x1ef9bf of section .text are not covered. error: .debug_loc: addresses 0x1efb3f..0x1efb3f of section .text are not covered. error: .debug_loc: addresses 0x1efbd8..0x1efbdf of section .text are not covered. error: .debug_loc: addresses 0x1efbe5..0x1efbef of section .text are not covered. }}} {{{ error: .debug_aranges: arange 0x160 (CU 88194504): couldn't find a section that the range 0..0x6c covers. error: .debug_aranges: arange 0x170 (CU 88194504): the range 0x415180..0x4151c0 overlaps with another one. error: .debug_aranges: arange 0x180 (CU 88194504): the range 0x1f6570..0x1f65b3 overlaps with another one. error: .debug_aranges: arange 0x190 (CU 88194504): couldn't find a section that the range 0..0xa6 covers. error: .debug_aranges: arange 0x1a0 (CU 88194504): the range 0x200270..0x2002b0 overlaps with another one. error: .debug_aranges: arange 0x1b0 (CU 88194504): couldn't find a section that the range 0..0x57 covers. error: .debug_aranges: arange 0x1d0 (CU 88194504): the range 0x3b2db0..0x3b2e6a overlaps with another one. }}} The coverage errors above seem to be real. This is eu-readelf output of another file with that problem: {{{ DWARF section [27] '.debug_aranges' at offset 0x30f contains 85 entries: [ 0] start: 0000000000, length: 321, CU DIE offset: 240301 [ 1] start: 0000000000, length: 262, CU DIE offset: 240301 }}} {{{ error: .debug_aranges: addresses 0x4980ae..0x4980af of section .text are not covered. error: .debug_aranges: addresses 0x4987a9..0x4987af of section .text are not covered. error: .debug_aranges: addresses 0x4987ca..0x4987cf of section .text are not covered. error: .debug_aranges: addresses 0x4987d8..0x4987df of section .text are not covered. error: .debug_aranges: addresses 0x49881a..0x49884f of section .text are not covered. warning: .debug_aranges (DIE 0x523a4): missing range 0x1f7000..0x1f729e, present in .debug_ranges. warning: .debug_aranges (DIE 0x523a4): missing range 0x1f72a0..0x1f753e, present in .debug_ranges. warning: .debug_ranges (DIE 0x89519): missing range 0x1f7570..0x1f7983, present in .debug_aranges. warning: .debug_aranges (DIE 0x9474b): missing range 0x1f7990..0x1f799e, present in .debug_ranges. warning: .debug_aranges (DIE 0x9474b): missing range 0x1f79a0..0x1f79a8, present in .debug_ranges. }}} Another file (cone-debuginfo-0.75-2.fc11.i386:usr:lib:debug:usr:libexec:cone.debug/cone.debug) {{{ warning: .debug_ranges: rangelist 0xea558: entry covers no range. warning: .debug_ranges: rangelist 0xec8c8: entry covers no range. And associated eu-readelf printout: [ ea558] 0x081c7270 <_ZN4mail11addressbook14GetAddressListINS_7addressEE14reportProgressEjjjj>..0x081c7270 <_ZN4mail11addressbook14GetAddress }}} Some files lack .debug_pubnames (frysk-debuginfo-0.4-8.fc11.i386:usr:lib:debug:usr:lib:frysk:funit-*.debug/*.debug). Perhaps related to JAVA? === Location leaks out of DIE scope === attachment:location-leaks.c dwarflint output: {{{ $ ./proj/elfutils/dwarflint/build/src/dwarflint location-leaks.3dd8cc519e012e6aab3ed42effc9704f warning: .debug_loc: loclist 0x38: entry covers no range. error: .debug_info: DIE 0x62: attribute `location': PC range [0x400495, 0x40049a) outside containing scope error: .debug_info: DIE 0x51: in this context: [0x400498, 0x4004b2) }}} appears in: * GNU C 4.4.1 20090725 (Red Hat 4.4.1-2) [attachment:location-leaks.3dd8cc519e012e6aab3ed42effc9704f binary] fixed in: * GNU C 4.4.1 20091005 (Red Hat 4.4.1-19) (That's 4.4.1 with VTA backported) == Relocations == === SHN_COMMON relocations === I found a case where a relocation of an address is formed against SHN_COMMON symbol. tests/test-nlist.o in elfutils "dwarf" branh exhibits this on x86_64, the last relocation in .rela.debug_info is formed against symbol #25, which is: {{{ Num: Value Size Type Bind Vis Ndx Name 25: 0000000000000004 4 OBJECT GLOBAL DEFAULT COMMON bss }}} How to handle this? === R_X86_64_DTPOFF32 relocations === Another case from elfutils: ./libelf/elf_error.os contains relocation with type "R_X86_64_DTPOFF32". EBL punts it. Is the bug in EBL library, or in the file?