File: debug-dead-reloc-32.s

package info (click to toggle)
swiftlang 6.1.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,791,604 kB
  • sloc: cpp: 9,901,740; ansic: 2,201,431; asm: 1,091,827; python: 308,252; objc: 82,166; f90: 80,126; lisp: 38,358; pascal: 25,559; sh: 20,429; ml: 5,058; perl: 4,745; makefile: 4,484; awk: 3,535; javascript: 3,018; xml: 918; fortran: 664; cs: 573; ruby: 396
file content (51 lines) | stat: -rw-r--r-- 1,916 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# REQUIRES: x86
## Test we resolve symbolic relocations in .debug_* sections to a tombstone
## value if the referenced symbol is discarded (--gc-sections, non-prevailing
## section group, SHF_EXCLUDE, /DISCARD/, etc).

# RUN: llvm-mc -filetype=obj -triple=i386 %s -o %t.o
# RUN: ld.lld %t.o -o %t
# RUN: llvm-objdump -s %t | FileCheck %s

# CHECK:      Contents of section .debug_loc:
# CHECK-NEXT:  0000 01000000
# CHECK-NEXT: Contents of section .debug_ranges:
# CHECK-NEXT:  0000 01000000
# CHECK-NEXT: Contents of section .debug_addr:
# CHECK-NEXT:  0000 00000000
# CHECK-NEXT: Contents of section .debug_names:
# CHECK-NEXT:  0000 ffffffff

## -z dead-reloc-in-nonalloc= can override the tombstone value.
# RUN: ld.lld -z dead-reloc-in-nonalloc=.debug_loc=42 -z dead-reloc-in-nonalloc=.debug_addr=0xfffffffffffffffe %t.o -o %t1
# RUN: llvm-objdump -s %t1 | FileCheck %s --check-prefix=OVERRIDE

# OVERRIDE:      Contents of section .debug_loc:
# OVERRIDE-NEXT:  0000 2a000000                             *...
# OVERRIDE-NEXT: Contents of section .debug_ranges:
# OVERRIDE-NEXT:  0000 01000000                             ....
# OVERRIDE-NEXT: Contents of section .debug_addr:
# OVERRIDE-NEXT:  0000 feffffff                             ....

.section .text.1,"axe"
  .byte 0

## Resolved to UINT32_C(-2), with the addend ignored.
## UINT32_C(-1) is a reserved value (base address selection entry) which can't be used.
.section .debug_loc
  .long .text.1+8
.section .debug_ranges
  .long .text.1+16

## Resolved to UINT32_C(0), with the addend ignored.
.section .debug_addr
  .long .text.1+8

.section  .debug_info,"eG",@progbits,5657452045627120676,comdat
.Ltu_begin0:

.section .debug_names
## .debug_names may reference a local type unit defined in a COMDAT .debug_info
## section (-g -gpubnames -fdebug-types-section). If the referenced section is
## non-prevailing, resolve to UINT32_MAX.
.long .Ltu_begin0