|
145 | 145 | # PIE-NEXT: segment section address type
|
146 | 146 | # PIE-EMPTY:
|
147 | 147 |
|
| 148 | +## Check that an absolute DW_AT_name does not have DW_AT_comp_dir prepended |
| 149 | +## when forming N_SO. |
| 150 | +# RUN: llvm-mc -filetype obj -triple=x86_64-apple-darwin %t/abs-path.s -o %t/abs-path.o |
| 151 | +# RUN: %lld %t/abs-path.o -o %t/test |
| 152 | +# RUN: (llvm-objdump --section-headers %t/test; dsymutil -s %t/test) | FileCheck %s --check-prefix=ABS-PATH |
| 153 | +# ABS-PATH: (N_SO ) 00 0000 0000000000000000 '/foo.cpp' |
| 154 | + |
148 | 155 | #--- test.s
|
149 | 156 |
|
150 | 157 | ## Make sure we don't create STABS entries for absolute symbols.
|
@@ -287,3 +294,53 @@ ltmp1:
|
287 | 294 | .globl _no_debug
|
288 | 295 | _no_debug:
|
289 | 296 | ret
|
| 297 | + |
| 298 | +#--- abs-path.s |
| 299 | +.text |
| 300 | +.globl _main |
| 301 | +_main: |
| 302 | +Lfunc_begin0: |
| 303 | + retq |
| 304 | +Lfunc_end0: |
| 305 | + |
| 306 | +.section __DWARF,__debug_str,regular,debug |
| 307 | + .asciz "/foo.cpp" ## string offset=0 |
| 308 | + .asciz "/tmp" ## string offset=9 |
| 309 | +.section __DWARF,__debug_abbrev,regular,debug |
| 310 | +Lsection_abbrev: |
| 311 | + .byte 1 ## Abbreviation Code |
| 312 | + .byte 17 ## DW_TAG_compile_unit |
| 313 | + .byte 1 ## DW_CHILDREN_yes |
| 314 | + .byte 3 ## DW_AT_name |
| 315 | + .byte 14 ## DW_FORM_strp |
| 316 | + .byte 27 ## DW_AT_comp_dir |
| 317 | + .byte 14 ## DW_FORM_strp |
| 318 | + .byte 17 ## DW_AT_low_pc |
| 319 | + .byte 1 ## DW_FORM_addr |
| 320 | + .byte 18 ## DW_AT_high_pc |
| 321 | + .byte 6 ## DW_FORM_data4 |
| 322 | + .byte 0 ## EOM(1) |
| 323 | + .byte 0 ## EOM(2) |
| 324 | + .byte 0 ## EOM(3) |
| 325 | +.section __DWARF,__debug_info,regular,debug |
| 326 | +.set Lset0, Ldebug_info_end0-Ldebug_info_start0 ## Length of Unit |
| 327 | + .long Lset0 |
| 328 | +Ldebug_info_start0: |
| 329 | + .short 4 ## DWARF version number |
| 330 | +.set Lset1, Lsection_abbrev-Lsection_abbrev ## Offset Into Abbrev. Section |
| 331 | + .long Lset1 |
| 332 | + .byte 8 ## Address Size (in bytes) |
| 333 | + .byte 1 ## Abbrev [1] 0xb:0x48 DW_TAG_compile_unit |
| 334 | + .long 0 ## DW_AT_name |
| 335 | + .long 9 ## DW_AT_comp_dir |
| 336 | + .quad Lfunc_begin0 ## DW_AT_low_pc |
| 337 | +.set Lset3, Lfunc_end0-Lfunc_begin0 ## DW_AT_high_pc |
| 338 | + .long Lset3 |
| 339 | + .byte 0 ## End Of Children Mark |
| 340 | +Ldebug_info_end0: |
| 341 | + |
| 342 | +.section __DWARF,__debug_aranges,regular,debug |
| 343 | +ltmp1: |
| 344 | + .byte 0 |
| 345 | + |
| 346 | +.subsections_via_symbols |
0 commit comments