File tree Expand file tree Collapse file tree 4 files changed +24
-2
lines changed Expand file tree Collapse file tree 4 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -1088,7 +1088,8 @@ unsigned DWARFLinker::DIECloner::cloneAddressAttribute(
1088
1088
1089
1089
if (AttrSpec.Attr == dwarf::DW_AT_low_pc) {
1090
1090
if (Die.getTag () == dwarf::DW_TAG_inlined_subroutine ||
1091
- Die.getTag () == dwarf::DW_TAG_lexical_block)
1091
+ Die.getTag () == dwarf::DW_TAG_lexical_block ||
1092
+ Die.getTag () == dwarf::DW_TAG_label) {
1092
1093
// The low_pc of a block or inline subroutine might get
1093
1094
// relocated because it happens to match the low_pc of the
1094
1095
// enclosing subprogram. To prevent issues with that, always use
@@ -1097,7 +1098,7 @@ unsigned DWARFLinker::DIECloner::cloneAddressAttribute(
1097
1098
? Info.OrigLowPc
1098
1099
: Addr) +
1099
1100
Info.PCOffset ;
1100
- else if (Die.getTag () == dwarf::DW_TAG_compile_unit) {
1101
+ } else if (Die.getTag () == dwarf::DW_TAG_compile_unit) {
1101
1102
Addr = Unit.getLowPc ();
1102
1103
if (Addr == std::numeric_limits<uint64_t >::max ())
1103
1104
return 0 ;
Original file line number Diff line number Diff line change
1
+ $ cat label.c
2
+ int main(int argc, char **argv) {
3
+ if (argc) {
4
+ goto foobar;
5
+ }
6
+ return 1;
7
+ foobar:
8
+ return 0;
9
+ }
10
+
11
+ $ clang -g label.c -c -o label.o
12
+ $ clang label.o -o label.out
13
+
14
+ RUN: dsymutil -oso-prepend-path %p/../Inputs %p/../Inputs/private/tmp/label/label.out -o %t.dSYM
15
+ RUN: dwarfdump %t.dSYM | FileCheck %s
16
+
17
+ CHECK: DW_TAG_label
18
+ CHECK-NEXT: DW_AT_name ("foobar")
19
+ CHECK-NEXT: DW_AT_decl_file ("/tmp/label/label.c")
20
+ CHECK-NEXT: DW_AT_decl_line (6)
21
+ CHECK-NEXT: DW_AT_low_pc (0x0000000100003f9d)
You can’t perform that action at this time.
0 commit comments