hanchenye-llvm-project/lld/test/pecoff/base-reloc.test

48 lines
2.0 KiB
Plaintext
Raw Normal View History

# RUN: yaml2obj %p/Inputs/hello.obj.yaml > %t.obj
#
# RUN: lld -flavor link /out:%t1 /subsystem:console /force /opt:noref \
# RUN: -- %t.obj \
# RUN: && llvm-objdump -s %t1 | FileCheck %s --check-prefix=BASEREL-SECTION
#
# RUN: lld -flavor link /out:%t1 /subsystem:console /force /fixed /opt:noref \
# RUN: -- %t.obj \
# RUN: && llvm-objdump -s %t1 | FileCheck %s --check-prefix=NOBASEREL-SECTION
# Because llvm-objdump cannot pretty-print the contents of .reloc section, we
# have no choice other than comparing the result with this binary blob.
#
# TODO: Improve llvm-objdump to pretty print .reloc section as GNU binutil
# objdump does.
BASEREL-SECTION: Contents of section .reloc:
BASEREL-SECTION-NEXT: 3000 00100000 0c000000 07300c30 00000000 .........0.0....
NOBASEREL-SECTION-NOT: Contents of section .reloc:
# RUN: lld -flavor link /out:%t1 /subsystem:console /force /opt:noref \
# RUN: -- %t.obj && llvm-readobj -file-headers -sections %t1 \
# RUN: | FileCheck %s --check-prefix=BASEREL-HEADER
#
# RUN: lld -flavor link /out:%t1 /subsystem:console /force /opt:noref /fixed \
# RUN: -- %t.obj && llvm-readobj -file-headers %t1 \
# RUN: | FileCheck %s --check-prefix=NOBASEREL-HEADER
BASEREL-HEADER-NOT: IMAGE_FILE_RELOCS_STRIPPED
NOBASEREL-HEADER: IMAGE_FILE_RELOCS_STRIPPED
BASEREL-HEADER: Name: .reloc (2E 72 65 6C 6F 63 00 00)
BASEREL-HEADER-NEXT: VirtualSize: 0xC
BASEREL-HEADER-NEXT: VirtualAddress: 0x3000
BASEREL-HEADER-NEXT: RawDataSize: 512
BASEREL-HEADER-NEXT: PointerToRawData: 0x600
BASEREL-HEADER-NEXT: PointerToRelocations: 0x0
BASEREL-HEADER-NEXT: PointerToLineNumbers: 0x0
BASEREL-HEADER-NEXT: RelocationCount: 0
BASEREL-HEADER-NEXT: LineNumberCount: 0
BASEREL-HEADER-NEXT: Characteristics [ (0x42000040)
BASEREL-HEADER-NEXT: IMAGE_SCN_CNT_INITIALIZED_DATA (0x40)
BASEREL-HEADER-NEXT: IMAGE_SCN_MEM_DISCARDABLE (0x2000000)
BASEREL-HEADER-NEXT: IMAGE_SCN_MEM_READ (0x40000000)
BASEREL-HEADER-NEXT: ]