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 @@ -1071,7 +1071,8 @@ unsigned DWARFLinker::DIECloner::cloneAddressAttribute(
1071
1071
1072
1072
if (AttrSpec.Attr == dwarf::DW_AT_low_pc) {
1073
1073
if (Die.getTag () == dwarf::DW_TAG_inlined_subroutine ||
1074
- Die.getTag () == dwarf::DW_TAG_lexical_block)
1074
+ Die.getTag () == dwarf::DW_TAG_lexical_block ||
1075
+ Die.getTag () == dwarf::DW_TAG_label) {
1075
1076
// The low_pc of a block or inline subroutine might get
1076
1077
// relocated because it happens to match the low_pc of the
1077
1078
// enclosing subprogram. To prevent issues with that, always use
@@ -1080,7 +1081,7 @@ unsigned DWARFLinker::DIECloner::cloneAddressAttribute(
1080
1081
? Info.OrigLowPc
1081
1082
: Addr) +
1082
1083
Info.PCOffset ;
1083
- else if (Die.getTag () == dwarf::DW_TAG_compile_unit) {
1084
+ } else if (Die.getTag () == dwarf::DW_TAG_compile_unit) {
1084
1085
Addr = Unit.getLowPc ();
1085
1086
if (Addr == std::numeric_limits<uint64_t >::max ())
1086
1087
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: llvm-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