diff --git a/bolt/lib/Rewrite/DWARFRewriter.cpp b/bolt/lib/Rewrite/DWARFRewriter.cpp --- a/bolt/lib/Rewrite/DWARFRewriter.cpp +++ b/bolt/lib/Rewrite/DWARFRewriter.cpp @@ -2161,16 +2161,16 @@ } else if (Unit.getVersion() < 4) { RangesForm = dwarf::DW_FORM_data4; } - + bool IsUnitDie = Die.getTag() == dwarf::DW_TAG_compile_unit || + Die.getTag() == dwarf::DW_TAG_skeleton_unit; + if (!IsUnitDie) + DIEBldr.deleteValue(&Die, LowPCAttrInfo.getAttribute()); // In DWARF4 for DW_AT_low_pc in binary DW_FORM_addr is used. In the DWO // section DW_FORM_GNU_addr_index is used. So for if we are converting // DW_AT_low_pc/DW_AT_high_pc and see DW_FORM_GNU_addr_index. We are // converting in DWO section, and DW_AT_ranges [DW_FORM_sec_offset] is // relative to DW_AT_GNU_ranges_base. if (LowForm == dwarf::DW_FORM_GNU_addr_index) { - // Use ULEB128 for the value. - DIEBldr.replaceValue(&Die, LowPCAttrInfo.getAttribute(), - LowPCAttrInfo.getForm(), DIEInteger(0)); // Ranges are relative to DW_AT_GNU_ranges_base. uint64_t CurRangeBase = 0; if (std::optional DWOId = Unit.getDWOId()) { @@ -2181,14 +2181,16 @@ // In DWARF 5 we can have DW_AT_low_pc either as DW_FORM_addr, or // DW_FORM_addrx. Former is when DW_AT_rnglists_base is present. Latter is // when it's absent. - if (LowForm == dwarf::DW_FORM_addrx) { - const uint32_t Index = AddrWriter->getIndexFromAddress(0, Unit); - DIEBldr.replaceValue(&Die, LowPCAttrInfo.getAttribute(), - LowPCAttrInfo.getForm(), DIEInteger(Index)); - } else - DIEBldr.replaceValue(&Die, LowPCAttrInfo.getAttribute(), - LowPCAttrInfo.getForm(), DIEInteger(0)); - + if (IsUnitDie) { + if (LowForm == dwarf::DW_FORM_addrx) { + const uint32_t Index = AddrWriter->getIndexFromAddress(0, Unit); + DIEBldr.replaceValue(&Die, LowPCAttrInfo.getAttribute(), + LowPCAttrInfo.getForm(), DIEInteger(Index)); + } else { + DIEBldr.replaceValue(&Die, LowPCAttrInfo.getAttribute(), + LowPCAttrInfo.getForm(), DIEInteger(0)); + } + } // Original CU didn't have DW_AT_*_base. We converted it's children (or // dwo), so need to insert it into CU. if (RangesBase) diff --git a/bolt/test/X86/debug-fission-single-convert.s b/bolt/test/X86/debug-fission-single-convert.s --- a/bolt/test/X86/debug-fission-single-convert.s +++ b/bolt/test/X86/debug-fission-single-convert.s @@ -31,13 +31,10 @@ # CHECK-DWO-DWO: 00000010 # CHECK-DWO-DWO: 00000050 # CHECK-DWO-DWO: DW_TAG_subprogram -# CHECK-DWO-DWO-NEXT: DW_AT_low_pc [DW_FORM_GNU_addr_index] (indexed (00000000) # CHECK-DWO-DWO-NEXT: DW_AT_ranges [DW_FORM_sec_offset] (0x00000000 # CHECK-DWO-DWO: DW_TAG_subprogram -# CHECK-DWO-DWO-NEXT: DW_AT_low_pc [DW_FORM_GNU_addr_index] (indexed (00000000) # CHECK-DWO-DWO-NEXT: DW_AT_ranges [DW_FORM_sec_offset] (0x00000020 # CHECK-DWO-DWO: DW_TAG_subprogram -# CHECK-DWO-DWO-NEXT: DW_AT_low_pc [DW_FORM_GNU_addr_index] (indexed (00000000) # CHECK-DWO-DWO-NEXT: DW_AT_ranges [DW_FORM_sec_offset] (0x00000040 # CHECK-ADDR-SEC: .debug_addr contents: diff --git a/bolt/test/X86/dwarf4-df-dualcu.test b/bolt/test/X86/dwarf4-df-dualcu.test --- a/bolt/test/X86/dwarf4-df-dualcu.test +++ b/bolt/test/X86/dwarf4-df-dualcu.test @@ -113,14 +113,12 @@ ; BOLT-DWO-MAIN-NEXT: DW_AT_decl_line ; BOLT-DWO-MAIN-NEXT: DW_AT_location [DW_FORM_exprloc] (DW_OP_GNU_addr_index 0x1) ; BOLT-DWO-MAIN: DW_TAG_subprogram [4] -; BOLT-DWO-MAIN-NEXT: DW_AT_low_pc [DW_FORM_GNU_addr_index] (indexed (00000000) ; BOLT-DWO-MAIN-NEXT: DW_AT_ranges [DW_FORM_sec_offset] (0x00000000 ; BOLT-DWO-MAIN-NEXT: ) ; BOLT-DWO-MAIN-NEXT: DW_AT_frame_base ; BOLT-DWO-MAIN-NEXT: DW_AT_linkage_name [DW_FORM_GNU_str_index] (indexed (00000003) string = "_Z3usePiS_") ; BOLT-DWO-MAIN-NEXT: DW_AT_name [DW_FORM_GNU_str_index] (indexed (00000004) string = "use") ; BOLT-DWO-MAIN: DW_TAG_subprogram [6] -; BOLT-DWO-MAIN-NEXT: DW_AT_low_pc [DW_FORM_GNU_addr_index] (indexed (00000000) ; BOLT-DWO-MAIN-NEXT: DW_AT_ranges [DW_FORM_sec_offset] (0x00000020 ; BOLT-DWO-MAIN-NEXT: ) ; BOLT-DWO-MAIN-NEXT: DW_AT_frame_base [DW_FORM_exprloc] (DW_OP_reg6 RBP) @@ -162,5 +160,4 @@ ; BOLT-DWO-HELPER-NEXT: DW_AT_decl_line ; BOLT-DWO-HELPER-NEXT: DW_AT_location [DW_FORM_exprloc] (DW_OP_GNU_addr_index 0x1) ; BOLT-DWO-HELPER: DW_TAG_subprogram [4] -; BOLT-DWO-HELPER-NEXT: DW_AT_low_pc [DW_FORM_GNU_addr_index] (indexed (00000000) ; BOLT-DWO-HELPER-NEXT: DW_AT_ranges [DW_FORM_sec_offset] (0x00000000 diff --git a/bolt/test/X86/dwarf5-df-dualcu.test b/bolt/test/X86/dwarf5-df-dualcu.test --- a/bolt/test/X86/dwarf5-df-dualcu.test +++ b/bolt/test/X86/dwarf5-df-dualcu.test @@ -29,7 +29,6 @@ ; BOLT-NEXT: 0x ; BOLT-NEXT: 0x ; BOLT-NEXT: 0x[[#%.16x,ADDR:]] -; BOLT-NEXT: 0x ; BOLT-NEXT: 0x[[#%.16x,ADDR2:]] ; BOLT: Addrs: [ ; BOLT-NEXT: 0x @@ -37,7 +36,7 @@ ; BOLT-NEXT: 0x[[#%.16x,ADDR3:]] ; BOLT: DW_TAG_skeleton_unit ; BOLT: DW_AT_dwo_name [DW_FORM_strx1] (indexed (00000001) string = "main.dwo.dwo") -; BOLT-NEXT: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000003) address = 0x0000000000000000) +; BOLT-NEXT: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000004) address = 0x0000000000000000) ; BOLT-NEXT: DW_AT_ranges [DW_FORM_rnglistx] (indexed (0x0) rangelist = 0x00000010 ; BOLT-NEXT: [0x[[#ADDR]] ; BOLT-SAME: 0x[[#ADDR + 0x24]] @@ -98,14 +97,12 @@ ; BOLT-DWO-MAIN-NEXT: DW_AT_decl_line ; BOLT-DWO-MAIN-NEXT: DW_AT_location [DW_FORM_exprloc] (DW_OP_addrx 0x1) ; BOLT-DWO-MAIN: DW_TAG_subprogram [4] -; BOLT-DWO-MAIN-NEXT: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000003) ; BOLT-DWO-MAIN-NEXT: DW_AT_ranges [DW_FORM_rnglistx] (indexed (0x0) rangelist = 0x00000014 ; BOLT-DWO-MAIN-NEXT: [0x0000000000000000, 0x0000000000000024)) ; BOLT-DWO-MAIN-NEXT: DW_AT_frame_base ; BOLT-DWO-MAIN-NEXT: DW_AT_linkage_name [DW_FORM_strx1] (indexed (00000003) string = "_Z3usePiS_") ; BOLT-DWO-MAIN-NEXT: DW_AT_name [DW_FORM_strx1] (indexed (00000004) string = "use") ; BOLT-DWO-MAIN: DW_TAG_subprogram [6] -; BOLT-DWO-MAIN-NEXT: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000003) ; BOLT-DWO-MAIN-NEXT: DW_AT_ranges [DW_FORM_rnglistx] (indexed (0x1) rangelist = 0x00000018 ; BOLT-DWO-MAIN-NEXT: [0x0000000000000000, 0x0000000000000059)) ; BOLT-DWO-MAIN-NEXT: DW_AT_frame_base [DW_FORM_exprloc] (DW_OP_reg6 RBP) @@ -146,6 +143,5 @@ ; BOLT-DWO-HELPER-NEXT: DW_AT_decl_line ; BOLT-DWO-HELPER-NEXT: DW_AT_location [DW_FORM_exprloc] (DW_OP_addrx 0x1) ; BOLT-DWO-HELPER: DW_TAG_subprogram [4] -; BOLT-DWO-HELPER-NEXT: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000003) ; BOLT-DWO-HELPER-NEXT: DW_AT_ranges [DW_FORM_rnglistx] (indexed (0x0) rangelist = 0x00000010 ; BOLT-DWO-HELPER-NEXT: [0x0000000000000000, 0x000000000000003d)) diff --git a/bolt/test/X86/dwarf5-df-mono-dualcu.test b/bolt/test/X86/dwarf5-df-mono-dualcu.test --- a/bolt/test/X86/dwarf5-df-mono-dualcu.test +++ b/bolt/test/X86/dwarf5-df-mono-dualcu.test @@ -30,13 +30,12 @@ ; BOLT-NEXT: 0x ; BOLT-NEXT: 0x ; BOLT-NEXT: 0x[[#%.16x,ADDR:]] -; BOLT-NEXT: 0x ; BOLT-NEXT: 0x[[#%.16x,ADDR2:]] ; BOLT: Addrs: [ ; BOLT-NEXT: 0x[[#%.16x,ADDR3:]] ; BOLT: DW_TAG_skeleton_unit ; BOLT: DW_AT_dwo_name [DW_FORM_strx1] (indexed (00000001) string = "main.dwo.dwo") -; BOLT-NEXT: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000003) address = 0x0000000000000000) +; BOLT-NEXT: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000004) address = 0x0000000000000000) ; BOLT-NEXT: DW_AT_ranges [DW_FORM_rnglistx] (indexed (0x0) rangelist = 0x00000010 ; BOLT-NEXT: [0x[[#ADDR]] ; BOLT-SAME: 0x[[#ADDR + 0x24]] @@ -67,7 +66,6 @@ ; BOLT-NEXT: DW_AT_decl_line ; BOLT-NEXT: DW_AT_location [DW_FORM_exprloc] (DW_OP_addrx 0x3) ; BOLT: DW_TAG_subprogram -; BOLT-NEXT: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000001) address = 0x0000000000000000) ; BOLT-NEXT: DW_AT_ranges [DW_FORM_rnglistx] (indexed (0x1) rangelist = 0x00000032 ; BOLT-NEXT: [0x[[#ADDR3]] ; BOLT-SAME: 0x[[#ADDR3 + 0x3D]] @@ -116,14 +114,12 @@ ; BOLT-DWO-MAIN-NEXT: DW_AT_decl_line ; BOLT-DWO-MAIN-NEXT: DW_AT_location [DW_FORM_exprloc] (DW_OP_addrx 0x1) ; BOLT-DWO-MAIN: DW_TAG_subprogram [4] -; BOLT-DWO-MAIN-NEXT: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000003) ; BOLT-DWO-MAIN-NEXT: DW_AT_ranges [DW_FORM_rnglistx] (indexed (0x0) rangelist = 0x00000014 ; BOLT-DWO-MAIN-NEXT: [0x0000000000000000, 0x0000000000000024)) ; BOLT-DWO-MAIN-NEXT: DW_AT_frame_base ; BOLT-DWO-MAIN-NEXT: DW_AT_linkage_name [DW_FORM_strx1] (indexed (00000003) string = "_Z3usePiS_") ; BOLT-DWO-MAIN-NEXT: DW_AT_name [DW_FORM_strx1] (indexed (00000004) string = "use") ; BOLT-DWO-MAIN: DW_TAG_subprogram [6] -; BOLT-DWO-MAIN-NEXT: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000003) ; BOLT-DWO-MAIN-NEXT: DW_AT_ranges [DW_FORM_rnglistx] (indexed (0x1) rangelist = 0x00000018 ; BOLT-DWO-MAIN-NEXT: [0x0000000000000000, 0x0000000000000059)) ; BOLT-DWO-MAIN-NEXT: DW_AT_frame_base [DW_FORM_exprloc] (DW_OP_reg6 RBP) diff --git a/bolt/test/X86/dwarf5-dwarf4-monolithic.test b/bolt/test/X86/dwarf5-dwarf4-monolithic.test --- a/bolt/test/X86/dwarf5-dwarf4-monolithic.test +++ b/bolt/test/X86/dwarf5-dwarf4-monolithic.test @@ -166,7 +166,6 @@ # POSTCHECK-NEXT: 0x[[#%.16x,ADDR4:]] # POSTCHECK-NEXT: 0x[[#%.16x,ADDR5:]] # POSTCHECK-NEXT: 0x[[#%.16x,ADDR6:]] -# POSTCHECK-NEXT: 0x[[#%.16x,ADDR7:]] # POSTCHECK: Addrs: [ # POSTCHECK-NEXT: 0x[[#%.16x,ADDRB:]] @@ -186,35 +185,33 @@ # POSTCHECK-NEXT: DW_AT_low_pc # POSTCHECK: DW_AT_ranges [DW_FORM_rnglistx] (indexed (0x0) # POSTCHECK-NEXT: [0x[[#ADDR]], 0x[[#ADDR + 0x7]] -# POSTCHECK-NEXT: [0x[[#ADDR2]], 0x[[#ADDR2 + 0x51]] +# POSTCHECK-NEXT: [0x[[#ADDR1]], 0x[[#ADDR1 + 0x51]] # POSTCHECK-NEXT: DW_AT_addr_base [DW_FORM_sec_offset] (0x00000008) # POSTCHECK-NEXT: DW_AT_rnglists_base [DW_FORM_sec_offset] (0x0000000c) # POSTCHECK-NEXT: DW_AT_loclists_base [DW_FORM_sec_offset] (0x0000000c) # POSTCHECK: DW_TAG_subprogram [2] -# POSTCHECK: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000001) address = 0x0000000000000000) # POSTCHECK-NEXT: DW_AT_ranges [DW_FORM_rnglistx] (indexed (0x1) rangelist # POSTCHECK-NEXT: [0x[[#ADDR]], 0x[[#ADDR + 0x7]] # POSTCHECK: DW_TAG_subprogram [8] -# POSTCHECK-NEXT: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000001) address = 0x0000000000000000) # POSTCHECK-NEXT: DW_AT_ranges [DW_FORM_rnglistx] (indexed (0x2) rangelist = 0x00000029 -# POSTCHECK-NEXT: [0x[[#ADDR2]], 0x[[#ADDR2 + 0x51]] +# POSTCHECK-NEXT: [0x[[#ADDR1]], 0x[[#ADDR1 + 0x51]] # POSTCHECK: DW_TAG_formal_parameter [9] # POSTCHECK-NEXT: DW_AT_location [DW_FORM_loclistx] (indexed (0x0) loclist = 0x00000018 -# POSTCHECK-NEXT: [0x[[#ADDR2]], 0x[[#ADDR2 + 0x22]] -# POSTCHECK-NEXT: [0x[[#ADDR2 + 0x22]], 0x[[#ADDR2 + 0x51]] +# POSTCHECK-NEXT: [0x[[#ADDR1]], 0x[[#ADDR1 + 0x22]] +# POSTCHECK-NEXT: [0x[[#ADDR1 + 0x22]], 0x[[#ADDR1 + 0x51]] # POSTCHECK: DW_TAG_formal_parameter [9] # POSTCHECK-NEXT: DW_AT_location [DW_FORM_loclistx] (indexed (0x1) loclist = 0x00000028 -# POSTCHECK-NEXT: [0x[[#ADDR2]], 0x[[#ADDR2 + 0x27]] -# POSTCHECK-NEXT: [0x[[#ADDR2 + 0x27]], 0x[[#ADDR2 + 0x51]] +# POSTCHECK-NEXT: [0x[[#ADDR1]], 0x[[#ADDR1 + 0x27]] +# POSTCHECK-NEXT: [0x[[#ADDR1 + 0x27]], 0x[[#ADDR1 + 0x51]] # POSTCHECK: DW_TAG_variable # POSTCHECK-NEXT: DW_AT_location [DW_FORM_loclistx] (indexed (0x2) loclist = 0x00000038 -# POSTCHECK-NEXT: [0x[[#ADDR3]], 0x[[#ADDR3 + 0x6]] -# POSTCHECK-NEXT: [0x[[#ADDR3 + 0x6]], 0x[[#ADDR3 + 0x46]] +# POSTCHECK-NEXT: [0x[[#ADDR2]], 0x[[#ADDR2 + 0x6]] +# POSTCHECK-NEXT: [0x[[#ADDR2 + 0x6]], 0x[[#ADDR2 + 0x46]] # POSTCHECK: DW_TAG_inlined_subroutine [12] # POSTCHECK-NEXT: DW_AT_abstract_origin # POSTCHECK-NEXT: DW_AT_ranges [DW_FORM_rnglistx] (indexed (0x3) rangelist = 0x0000002d -# POSTCHECK-NEXT: [0x[[#ADDR4]], 0x[[#ADDR4 + 0x4]] -# POSTCHECK-NEXT: [0x[[#ADDR4 + 0x10]], 0x[[#ADDR4 + 0x16]] +# POSTCHECK-NEXT: [0x[[#ADDR3]], 0x[[#ADDR3 + 0x4]] +# POSTCHECK-NEXT: [0x[[#ADDR3 + 0x10]], 0x[[#ADDR3 + 0x16]] # helper0.cpp # POSTCHECK: version = 0x0004 @@ -228,7 +225,6 @@ # POSTCHECK-NEXT: DW_AT_ranges [DW_FORM_sec_offset] # POSTCHECK-NEXT: [0x # POSTCHECK: DW_TAG_subprogram [22] -# POSTCHECK-NEXT: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000) # POSTCHECK-NEXT: DW_AT_ranges [DW_FORM_sec_offset] # POSTCHECK-NEXT: [0x # POSTCHECK: DW_TAG_variable [24] @@ -237,7 +233,6 @@ # POSTCHECK-NEXT: [0x # POSTCHECK: DW_TAG_inlined_subroutine [25] # POSTCHECK-NEXT: DW_AT_abstract_origin -# POSTCHECK-NEXT: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000) # POSTCHECK-NEXT: DW_AT_ranges [DW_FORM_sec_offset] # POSTCHECK-NEXT: [0x @@ -264,16 +259,14 @@ # POSTCHECK-NEXT: DW_AT_decl_line # POSTCHECK: DW_AT_location [DW_FORM_exprloc] (DW_OP_addrx 0x2) # POSTCHECK: DW_TAG_subprogram [29] -# POSTCHECK-NEXT: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000001) # POSTCHECK-NEXT: DW_AT_ranges [DW_FORM_rnglistx] (indexed (0x1) # POSTCHECK-NEXT: [0x[[#ADDRB]], 0x[[#ADDRB + 0x4]] # POSTCHECK: DW_TAG_variable [10] # POSTCHECK-NEXT: DW_AT_location [DW_FORM_loclistx] (indexed (0x0) # POSTCHECK-NEXT: [0x[[#ADDRB]], 0x[[#ADDRB + 0x3]] # POSTCHECK-NEXT: [0x[[#ADDRB + 0x3]], 0x[[#ADDRB + 0x4]] -# POSTCHECK: DW_TAG_inlined_subroutine [31] +# POSTCHECK: DW_TAG_inlined_subroutine # POSTCHECK-NEXT: DW_AT_abstract_origin -# POSTCHECK-NEXT: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000001) # POSTCHECK-NEXT: DW_AT_ranges [DW_FORM_rnglistx] (indexed (0x2) rangelist # POSTCHECK-NEXT: [0x[[#ADDRB]], 0x[[#ADDRB + 0x3]] @@ -289,7 +282,6 @@ # POSTCHECK-NEXT: DW_AT_ranges [DW_FORM_sec_offset] # POSTCHECK-NEXT: [0x # POSTCHECK: DW_TAG_subprogram [22] -# POSTCHECK-NEXT: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000) # POSTCHECK-NEXT: DW_AT_ranges [DW_FORM_sec_offset] # POSTCHECK-NEXT: [0x # POSTCHECK: DW_TAG_variable [24] @@ -298,7 +290,6 @@ # POSTCHECK-NEXT: [0x # POSTCHECK: DW_TAG_inlined_subroutine [25] # POSTCHECK-NEXT: DW_AT_abstract_origin -# POSTCHECK-NEXT: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000) # POSTCHECK-NEXT: DW_AT_ranges [DW_FORM_sec_offset] # POSTCHECK-NEXT: [0x diff --git a/bolt/test/X86/dwarf5-locaddrx.test b/bolt/test/X86/dwarf5-locaddrx.test --- a/bolt/test/X86/dwarf5-locaddrx.test +++ b/bolt/test/X86/dwarf5-locaddrx.test @@ -25,10 +25,9 @@ ; BOLT-NEXT: 0x ; BOLT-NEXT: 0x ; BOLT-NEXT: 0x[[#%.16x,ADDR:]] -; BOLT-NEXT: 0x ; BOLT-NEXT: 0x[[#%.16x,ADDR2:]] ; BOLT: DW_TAG_skeleton_unit -; BOLT: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000003) address = 0x0000000000000000) +; BOLT: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000004) address = 0x0000000000000000) ; BOLT-NEXT: DW_AT_ranges [DW_FORM_rnglistx] (indexed (0x0) rangelist = 0x00000010 ; BOLT-NEXT: [0x[[#ADDR]] ; BOLT-SAME: 0x[[#ADDR + 0x24]] @@ -76,10 +75,8 @@ ; BOLT-DWO-NEXT: DW_AT_decl_line ; BOLT-DWO-NEXT: DW_AT_location [DW_FORM_exprloc] (DW_OP_addrx 0x1) ; BOLT-DWO: DW_TAG_subprogram [4] -; BOLT-DWO-NEXT: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000003) ; BOLT-DWO-NEXT: DW_AT_ranges [DW_FORM_rnglistx] (indexed (0x0) rangelist = 0x00000014 ; BOLT-DWO-NEXT: [0x0000000000000000, 0x0000000000000024)) ; BOLT-DWO: DW_TAG_subprogram [6] -; BOLT-DWO-NEXT: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000003) ; BOLT-DWO-NEXT: DW_AT_ranges [DW_FORM_rnglistx] (indexed (0x1) rangelist = 0x00000018 ; BOLT-DWO-NEXT: [0x0000000000000000, 0x0000000000000054)) diff --git a/bolt/test/X86/dwarf5-split-dwarf4-monolithic.test b/bolt/test/X86/dwarf5-split-dwarf4-monolithic.test --- a/bolt/test/X86/dwarf5-split-dwarf4-monolithic.test +++ b/bolt/test/X86/dwarf5-split-dwarf4-monolithic.test @@ -137,7 +137,6 @@ # POSTCHECK-NEXT: 0x[[#%.16x,ADDR4:]] # POSTCHECK-NEXT: 0x[[#%.16x,ADDR5:]] # POSTCHECK-NEXT: 0x[[#%.16x,ADDR6:]] -# POSTCHECK-NEXT: 0x[[#%.16x,ADDR7:]] # POSTCHECK: Addrs: [ # POSTCHECK-NEXT: 0x[[#%.16x,ADDRB:]] @@ -155,7 +154,7 @@ # POSTCHECK-NEXT: DW_AT_low_pc # POSTCHECK-NEXT: DW_AT_ranges [DW_FORM_rnglistx] (indexed (0x0) # POSTCHECK-NEXT: [0x[[#ADDR]], 0x[[#ADDR + 0x7]] -# POSTCHECK-NEXT: [0x[[#ADDR2]], 0x[[#ADDR2 + 0x51]] +# POSTCHECK-NEXT: [0x[[#ADDR1]], 0x[[#ADDR1 + 0x51]] # POSTCHECK-NEXT: DW_AT_addr_base [DW_FORM_sec_offset] # POSTCHECK-NEXT: DW_AT_rnglists_base [DW_FORM_sec_offset] @@ -171,7 +170,6 @@ # POSTCHECK-NEXT: DW_AT_ranges [DW_FORM_sec_offset] # POSTCHECK-NEXT: [0x # POSTCHECK: DW_TAG_subprogram [8] -# POSTCHECK-NEXT: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000) # POSTCHECK-NEXT: DW_AT_ranges [DW_FORM_sec_offset] # POSTCHECK-NEXT: [0x # POSTCHECK: DW_TAG_variable [10] @@ -180,7 +178,6 @@ # POSTCHECK-NEXT: [0x # POSTCHECK: DW_TAG_inlined_subroutine [11] # POSTCHECK-NEXT: DW_AT_abstract_origin -# POSTCHECK-NEXT: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000) # POSTCHECK-NEXT: DW_AT_ranges [DW_FORM_sec_offset] # POSTCHECK-NEXT: [0x @@ -210,7 +207,6 @@ # POSTCHECK-NEXT: DW_AT_ranges [DW_FORM_sec_offset] # POSTCHECK-NEXT: [0x # POSTCHECK: DW_TAG_subprogram [8] -# POSTCHECK-NEXT: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000) # POSTCHECK-NEXT: DW_AT_ranges [DW_FORM_sec_offset] # POSTCHECK-NEXT: [0x # POSTCHECK: DW_TAG_variable [10] @@ -219,45 +215,41 @@ # POSTCHECK-NEXT: [0x # POSTCHECK: DW_TAG_inlined_subroutine [11] # POSTCHECK-NEXT: DW_AT_abstract_origin -# POSTCHECK-NEXT: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000) # POSTCHECK-NEXT: DW_AT_ranges [DW_FORM_sec_offset] # POSTCHECK-NEXT: [0x # POSTCHECK-DWO-MAIN: version = 0x0005 # POSTCHECK-DWO-MAIN: DW_TAG_compile_unit # POSTCHECK-DWO-MAIN: DW_TAG_subprogram [2] -# POSTCHECK-DWO-MAIN-NEXT: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000001) # POSTCHECK-DWO-MAIN-NEXT: DW_AT_ranges [DW_FORM_rnglistx] (indexed (0x0) rangelist = 0x00000018 # POSTCHECK-DWO-MAIN-NEXT: [0x0000000000000000, 0x0000000000000007)) # POSTCHECK-DWO-MAIN: DW_TAG_subprogram [8] -# POSTCHECK-DWO-MAIN-NEXT: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000001) # POSTCHECK-DWO-MAIN-NEXT: DW_AT_ranges [DW_FORM_rnglistx] (indexed (0x1) rangelist = 0x0000001c # POSTCHECK-DWO-MAIN-NEXT: [0x0000000000000000, 0x0000000000000051)) # POSTCHECK-DWO-MAIN: DW_TAG_formal_parameter [9] # POSTCHECK-DWO-MAIN-NEXT: DW_AT_location [DW_FORM_loclistx] (indexed (0x0) loclist = 0x00000018: -# POSTCHECK-DWO-MAIN-NEXT: DW_LLE_base_addressx (0x0000000000000002) +# POSTCHECK-DWO-MAIN-NEXT: DW_LLE_base_addressx (0x0000000000000001) # POSTCHECK-DWO-MAIN-NEXT: DW_LLE_offset_pair (0x0000000000000000, 0x0000000000000022): DW_OP_reg5 RDI # POSTCHECK-DWO-MAIN-NEXT: DW_LLE_offset_pair (0x0000000000000022, 0x0000000000000051): DW_OP_entry_value(DW_OP_reg5 RDI), DW_OP_stack_value) # POSTCHECK-DWO-MAIN: DW_TAG_formal_parameter [9] # POSTCHECK-DWO-MAIN-NEXT: DW_AT_location [DW_FORM_loclistx] (indexed (0x1) loclist = 0x00000028: -# POSTCHECK-DWO-MAIN-NEXT: DW_LLE_base_addressx (0x0000000000000002) +# POSTCHECK-DWO-MAIN-NEXT: DW_LLE_base_addressx (0x0000000000000001) # POSTCHECK-DWO-MAIN-NEXT: DW_LLE_offset_pair (0x0000000000000000, 0x0000000000000027): DW_OP_reg4 RSI # POSTCHECK-DWO-MAIN-NEXT: DW_LLE_offset_pair (0x0000000000000027, 0x0000000000000051): DW_OP_entry_value(DW_OP_reg4 RSI), DW_OP_stack_value) # POSTCHECK-DWO-MAIN: DW_TAG_variable [10] # POSTCHECK-DWO-MAIN-NEXT: DW_AT_location [DW_FORM_loclistx] (indexed (0x2) loclist = 0x00000038: -# POSTCHECK-DWO-MAIN-NEXT: DW_LLE_base_addressx (0x0000000000000003) +# POSTCHECK-DWO-MAIN-NEXT: DW_LLE_base_addressx (0x0000000000000002) # POSTCHECK-DWO-MAIN-NEXT: DW_LLE_offset_pair (0x0000000000000000, 0x0000000000000006): DW_OP_reg5 RDI # POSTCHECK-DWO-MAIN-NEXT: DW_LLE_offset_pair (0x0000000000000006, 0x0000000000000046): DW_OP_reg14 R14) # POSTCHECK-DWO-MAIN: DW_TAG_inlined_subroutine [12] # POSTCHECK-DWO-MAIN-NEXT: DW_AT_abstract_origin [DW_FORM_ref4] # POSTCHECK-DWO-MAIN-NEXT: DW_AT_ranges [DW_FORM_rnglistx] (indexed (0x2) rangelist = 0x00000020 # Encded as a pair. So it's offset from base address. -# POSTCHECK-DWO-MAIN-NEXT: [0x0000000000000004, 0x0000000000000008) -# POSTCHECK-DWO-MAIN-NEXT: [0x0000000000000014, 0x000000000000001a)) +# POSTCHECK-DWO-MAIN-NEXT: [0x0000000000000003, 0x0000000000000007) +# POSTCHECK-DWO-MAIN-NEXT: [0x0000000000000013, 0x0000000000000019)) # POSTCHECK-DWO-HELPER1: version = 0x0005 # POSTCHECK-DWO-HELPER1: DW_TAG_subprogram [7] -# POSTCHECK-DWO-HELPER1-NEXT: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000002) address # POSTCHECK-DWO-HELPER1-NEXT: DW_AT_ranges [DW_FORM_rnglistx] (indexed (0x0) rangelist = 0x00000014 # POSTCHECK-DWO-HELPER1-NEXT: [0x0000000000000000, 0x0000000000000004)) # POSTCHECK-DWO-HELPER1: DW_TAG_variable [9] @@ -267,7 +259,6 @@ # POSTCHECK-DWO-HELPER1-NEXT: DW_LLE_offset_pair (0x0000000000000003, 0x0000000000000004): DW_OP_reg0 RAX) # POSTCHECK-DWO-HELPER1: DW_TAG_inlined_subroutine [10] # POSTCHECK-DWO-HELPER1-NEXT: DW_AT_abstract_origin -# POSTCHECK-DWO-HELPER1-NEXT: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000002) address # POSTCHECK-DWO-HELPER1-NEXT: DW_AT_ranges [DW_FORM_rnglistx] (indexed (0x1) rangelist = 0x00000018 # POSTCHECK-DWO-HELPER1-NEXT: [0x0000000000000000, 0x0000000000000003)) diff --git a/bolt/test/X86/dwarf5-two-rnglists.test b/bolt/test/X86/dwarf5-two-rnglists.test --- a/bolt/test/X86/dwarf5-two-rnglists.test +++ b/bolt/test/X86/dwarf5-two-rnglists.test @@ -54,18 +54,12 @@ # POSTCHECK-NEXT: DW_AT_rnglists_base [DW_FORM_sec_offset] (0x0000000c) # POSTCHECK-EMPTY # POSTCHECK: DW_TAG_subprogram -# POSTCHECK-NEXT: DW_AT_low_pc [DW_FORM_addrx] -# POSTCHECK-SAME: indexed (00000001) -# POSTCHECK-SAME: address = 0x0000000000000000 # POSTCHECK-NEXT: DW_AT_ranges [DW_FORM_rnglistx] # POSTCHECK-SAME: indexed (0x1) # POSTCHECK-SAME: rangelist = 0x00000021 # POSTCHECK-NEXT: [0x[[#ADDR]], 0x[[#ADDR + 7]]) # POSTCHECK: DW_TAG_subprogram -# POSTCHECK-NEXT: DW_AT_low_pc [DW_FORM_addrx] -# POSTCHECK-SAME: indexed (00000001) -# POSTCHECK-SAME: address = 0x0000000000000000 # POSTCHECK-NEXT: DW_AT_ranges [DW_FORM_rnglistx] # POSTCHECK-SAME: indexed (0x2) # POSTCHECK-SAME: rangelist = 0x00000025 @@ -84,18 +78,12 @@ # POSTCHECK-EMPTY # POSTCHECK: DW_TAG_subprogram -# POSTCHECK-NEXT: DW_AT_low_pc [DW_FORM_addrx] -# POSTCHECK-SAME: indexed (00000001) -# POSTCHECK-SAME: address = 0x0000000000000000 # POSTCHECK-NEXT: DW_AT_ranges [DW_FORM_rnglistx] # POSTCHECK-SAME: indexed (0x1) # POSTCHECK-SAME: rangelist = 0x0000004e # POSTCHECK-NEXT: [0x[[#ADDR3]], 0x[[#ADDR3 + 4]]) # POSTCHECK: DW_TAG_subprogram # POSTCHECK: DW_TAG_subprogram -# POSTCHECK-NEXT: DW_AT_low_pc [DW_FORM_addrx] -# POSTCHECK-SAME: indexed (00000001) -# POSTCHECK-SAME: address = 0x0000000000000000 # POSTCHECK-NEXT: DW_AT_ranges [DW_FORM_rnglistx] # POSTCHECK-SAME: indexed (0x2) # POSTCHECK-SAME: rangelist = 0x00000052 @@ -103,9 +91,6 @@ # POSTCHECK: DW_TAG_inlined_subroutine # POSTCHECK-NEXT: DW_AT_abstract_origin -# POSTCHECK-NEXT: DW_AT_low_pc [DW_FORM_addrx] -# POSTCHECK-SAME: indexed (00000001) -# POSTCHECK-SAME: address = 0x0000000000000000 # POSTCHECK-NEXT: DW_AT_ranges [DW_FORM_rnglistx] # POSTCHECK-SAME: indexed (0x3) # POSTCHECK-SAME: rangelist = 0x00000056