File: strip-unneeded-aarch64.test

package info (click to toggle)
llvm-toolchain-14 1%3A14.0.6-12
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,496,180 kB
  • sloc: cpp: 5,593,972; ansic: 986,872; asm: 585,869; python: 184,223; objc: 72,530; lisp: 31,119; f90: 27,793; javascript: 9,780; pascal: 9,762; sh: 9,482; perl: 7,468; ml: 5,432; awk: 3,523; makefile: 2,538; xml: 953; cs: 573; fortran: 567
file content (53 lines) | stat: -rw-r--r-- 1,474 bytes parent folder | download | duplicates (16)
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
52
53
## Check that llvm-objcopy preserves AArch64 mapping symbols for relocatable files.
# RUN: yaml2obj %s -o %t.o -DTYPE=REL
# RUN: llvm-objcopy --strip-unneeded %t.o %t1.o
# RUN: llvm-nm -j --special-syms %t1.o | FileCheck %s --match-full-lines
# RUN: llvm-objcopy --discard-all %t.o %t2.o
# RUN: llvm-nm -j --special-syms %t2.o | FileCheck %s --match-full-lines

# CHECK:      $d
# CHECK-NEXT: $d.d
# CHECK-NEXT: $x
# CHECK-NEXT: $x.x

## A mapping symbol can be deleted if specified explicitly.
# RUN: llvm-objcopy -w -N '$d*' %t.o %t3.o
# RUN: llvm-nm --special-syms %t3.o | FileCheck /dev/null --implicit-check-not='$d'

## Mapping symbols are not preserved for executable files
# RUN: yaml2obj %s -o %t.exec -DTYPE=EXEC
# RUN: llvm-objcopy --strip-unneeded %t.exec %t1.exec
# RUN: llvm-nm --special-syms %t1.exec | count 0

# RUN: yaml2obj %s -o %t.so -DTYPE=DYN
# RUN: llvm-objcopy --strip-unneeded %t.so %t1.so
# RUN: llvm-nm --special-syms %t1.so | count 0

!ELF
FileHeader:
  Class:    ELFCLASS64
  Data:     ELFDATA2LSB
  Type:     ET_[[TYPE]]
  Machine:  EM_AARCH64
Sections:
  - Name: .text
    Type: SHT_PROGBITS
Symbols:
  - Name:     $a
    Section:  .text
  - Name:     $d
    Section:  .text
  - Name:     $dd
    Section:  .text
  - Name:     $d.d
    Section:  .text
  - Name:     $m
    Section:  .text
  - Name:     $t.t
    Section:  .text
  - Name:     $x
    Section:  .text
  - Name:     $xx
    Section:  .text
  - Name:     $x.x
    Section:  .text