1RUN: %python %p/../Inputs/ungzip.py %p/Inputs/bigobj.o.gz > %t.in.o 2 3RUN: llvm-objdump -t %t.in.o | FileCheck %s --check-prefixes=SYMBOLS,SYMBOLS-BIG,SYMBOLS-ORIG 4 5# Do a plain copy, to check that section numbers in symbols referring 6# to sections outside of the small object format are handled correctly. 7RUN: llvm-objcopy -R '.text$4' %t.in.o %t.small.o 8RUN: llvm-objdump -t %t.in.o | FileCheck %s --check-prefixes=SYMBOLS,SYMBOLS-BIG,SYMBOLS-ORIG 9 10# Remove a section, making the section count fit into a small object. 11RUN: llvm-objcopy -R '.text$4' %t.in.o %t.small.o 12RUN: llvm-objdump -t %t.small.o | FileCheck %s --check-prefixes=SYMBOLS,SYMBOLS-SMALL,SYMBOLS-REMOVED-SMALL 13 14# Add a .gnu_debuglink section, forcing the object back to big format. 15RUN: llvm-objcopy --add-gnu-debuglink=%t.in.o %t.small.o %t.big.o 16 llvm-objdump -t %t.big.o | FileCheck %s --check-prefixes=SYMBOLS,SYMBOLS-BIG,SYMBOLS-REMOVED-BIG 17 18# In big object format, the .file symbol occupies one symbol table entry for 19# the auxillary data, but needs two entries in the small format, forcing the 20# raw symbol indices of later symbols to change. 21SYMBOLS: SYMBOL TABLE: 22SYMBOLS-NEXT: [ 0]{{.*}} (nx 1) {{.*}} .text 23SYMBOLS-NEXT: AUX scnlen 24SYMBOLS-SMALL-NEXT: [ 2]{{.*}} (nx 2) {{.*}} .file 25SYMBOLS-BIG-NEXT: [ 2]{{.*}} (nx 1) {{.*}} .file 26SYMBOLS-NEXT: AUX abcdefghijklmnopqrs 27SYMBOLS-SMALL-NEXT: [ 5]{{.*}} (nx 0) {{.*}} foo 28SYMBOLS-BIG-NEXT: [ 4]{{.*}} (nx 0) {{.*}} foo 29 30# Check that the section numbers outside of signed 16 bit int range 31# are represented properly. After removing one section, the section 32# numbers decrease. 33SYMBOLS-ORIG: [ 5](sec 65280){{.*}} symbol65280 34SYMBOLS-REMOVED-SMALL: [ 6](sec 65279){{.*}} symbol65280 35SYMBOLS-REMOVED-BIG: [ 5](sec 65279){{.*}} symbol65280 36