blob: 369559986a7d5c0c56528b7f7e1b47e319587c62 [file] [log] [blame]
RUN: %python %p/../Inputs/ %p/Inputs/bigobj.o.gz >
RUN: llvm-objdump -t | 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.small.o
RUN: llvm-objdump -t | 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.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 %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-NEXT: [ 0]{{.*}} (nx 1) {{.*}} .text
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