File: bigobj.test

package info (click to toggle)
llvm-toolchain-21 1%3A21.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,235,796 kB
  • sloc: cpp: 7,617,614; ansic: 1,433,901; asm: 1,058,726; python: 252,096; f90: 94,671; objc: 70,753; lisp: 42,813; pascal: 18,401; sh: 10,032; ml: 5,111; perl: 4,720; awk: 3,523; makefile: 3,401; javascript: 2,272; xml: 892; fortran: 770
file content (35 lines) | stat: -rw-r--r-- 1,811 bytes parent folder | download | duplicates (17)
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
RUN: %python %p/../Inputs/ungzip.py %p/Inputs/bigobj.o.gz > %t.in.o

RUN: llvm-objdump -t %t.in.o | FileCheck %s --check-prefixes=SYMBOLS,SYMBOLS-BIG,SYMBOLS-ORIG

# Do a plain copy, to check that section numbers in symbols referring
# to sections outside of the small object format are handled correctly.
RUN: llvm-objcopy -R '.text$4' %t.in.o %t.small.o
RUN: llvm-objdump -t %t.in.o | FileCheck %s --check-prefixes=SYMBOLS,SYMBOLS-BIG,SYMBOLS-ORIG

# Remove a section, making the section count fit into a small object.
RUN: llvm-objcopy -R '.text$4' %t.in.o %t.small.o
RUN: llvm-objdump -t %t.small.o | FileCheck %s --check-prefixes=SYMBOLS,SYMBOLS-SMALL,SYMBOLS-REMOVED-SMALL

# Add a .gnu_debuglink section, forcing the object back to big format.
RUN: llvm-objcopy --add-gnu-debuglink=%t.in.o %t.small.o %t.big.o
RUN: llvm-objdump -t %t.big.o | FileCheck %s --check-prefixes=SYMBOLS,SYMBOLS-BIG,SYMBOLS-REMOVED-BIG

# In big object format, the .file symbol occupies one symbol table entry for
# the auxillary data, but needs two entries in the small format, forcing the
# raw symbol indices of later symbols to change.
SYMBOLS:            SYMBOL TABLE:
SYMBOLS-NEXT:       [ 0]{{.*}} (nx 1) {{.*}} .text
SYMBOLS-NEXT:       AUX scnlen
SYMBOLS-SMALL-NEXT: [ 2]{{.*}} (nx 2) {{.*}} .file
SYMBOLS-BIG-NEXT:   [ 2]{{.*}} (nx 1) {{.*}} .file
SYMBOLS-NEXT:       AUX abcdefghijklmnopqrs
SYMBOLS-SMALL-NEXT: [ 5]{{.*}} (nx 0) {{.*}} foo
SYMBOLS-BIG-NEXT:   [ 4]{{.*}} (nx 0) {{.*}} foo

# Check that the section numbers outside of signed 16 bit int range
# are represented properly. After removing one section, the section
# numbers decrease.
SYMBOLS-ORIG:          [ 5](sec 65280){{.*}} symbol65280
SYMBOLS-REMOVED-SMALL: [ 6](sec 65279){{.*}} symbol65280
SYMBOLS-REMOVED-BIG:   [ 5](sec 65279){{.*}} symbol65280