Skip to content

broken dwarf (LLVM-351) #98

Open
Open
@yamt

Description

@yamt

the following is with esp-17.0.1_20240419 built locally.
at least, DW_AT_producer, DW_AT_name, DW_AT_decl_file, DW_AT_comp_dir seem broken.

spacetanuki% cat a.c
int f(int x) { return x; }
spacetanuki% /Volumes/PortableSSD/llvm-xtensa/llvm-project/build/bin/clang -c -Os -g a.c
spacetanuki% llvm-dwarfdump a.o                                                          
warning: failed to compute relocation: R_XTENSA_32, Invalid data was encountered while parsing the file
warning: failed to compute relocation: R_XTENSA_32, Invalid data was encountered while parsing the file
warning: failed to compute relocation: R_XTENSA_32, Invalid data was encountered while parsing the file
warning: failed to compute relocation: R_XTENSA_32, Invalid data was encountered while parsing the file
warning: failed to compute relocation: R_XTENSA_32, Invalid data was encountered while parsing the file
warning: failed to compute relocation: R_XTENSA_32, Invalid data was encountered while parsing the file
warning: failed to compute relocation: R_XTENSA_32, Invalid data was encountered while parsing the file
warning: failed to compute relocation: R_XTENSA_32, Invalid data was encountered while parsing the file
warning: failed to compute relocation: R_XTENSA_32, Invalid data was encountered while parsing the file
warning: failed to compute relocation: R_XTENSA_32, Invalid data was encountered while parsing the file
warning: failed to compute relocation: R_XTENSA_32, Invalid data was encountered while parsing the file
warning: failed to compute relocation: R_XTENSA_32, Invalid data was encountered while parsing the file
warning: failed to compute relocation: R_XTENSA_32, Invalid data was encountered while parsing the file
warning: failed to compute relocation: R_XTENSA_32, Invalid data was encountered while parsing the file
a.o: Error in creating MCRegInfo  
a.o:    file format elf32-xtensa                                              
                                       
.debug_info contents:                                                         
0x00000000: Compile Unit: length = 0x0000003e, format = DWARF32, version = 0x0005, unit_type = DW_UT_compile, abbr_offset = 0x0000, addr_size = 0x04 (next un
it at 0x00000042)                     
error: invalid reference to or invalid content in .debug_str_offsets[.dwo]: insufficient space for 32 bit header prefix
                                       
0x0000000c: DW_TAG_compile_unit
              DW_AT_producer    ()
              DW_AT_language    (DW_LANG_C11)
              DW_AT_name        ()
              DW_AT_str_offsets_base    (0x00000000)
              DW_AT_stmt_list   (0x00000000)
              DW_AT_comp_dir    ()
              DW_AT_low_pc      (0x00000008)
              DW_AT_high_pc     (0x0000000d)
              DW_AT_addr_base   (0x00000000)

0x00000023:   DW_TAG_subprogram
                DW_AT_low_pc    (0x00000008)
                DW_AT_high_pc   (0x0000000d)
                DW_AT_frame_base        (DW_OP_reg1)
                DW_AT_call_all_calls    (true)
                DW_AT_name      ()
                DW_AT_decl_file ("/tmp/t7")
                DW_AT_decl_line (1)
                DW_AT_prototyped        (true)
                DW_AT_type      (0x0000003d "base ")
                DW_AT_external  (true)

0x00000032:     DW_TAG_formal_parameter
                  DW_AT_location        (DW_OP_reg2)
                  DW_AT_name    ()
                  DW_AT_decl_file       ("/tmp/t7")
                  DW_AT_decl_line       (1)
                  DW_AT_type    (0x0000003d "base ")

0x0000003c:     NULL

0x0000003d:   DW_TAG_base_type
                DW_AT_name      ()
                DW_AT_encoding  (DW_ATE_signed)
                DW_AT_byte_size (0x04)

0x00000041:   NULL
spacetanuki% 

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions