llvm-6502/test/MC/COFF/weak.s
David Majnemer b3a86a097b Object: Add support for bigobj
This adds support for reading the "bigobj" variant of COFF produced by
cl's /bigobj and mingw's -mbig-obj.

The most significant difference that bigobj brings is more than 2**16
sections to COFF.

bigobj brings a few interesting differences with it:
- It doesn't have a Characteristics field in the file header.
- It doesn't have a SizeOfOptionalHeader field in the file header (it's
  only used in executable files).
- Auxiliary symbol records have the same width as a symbol table entry.
  Since symbol table entries are bigger, so are auxiliary symbol
  records.

Write support will come soon.

Differential Revision: http://reviews.llvm.org/D5259

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217496 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-10 12:51:52 +00:00

74 lines
2.1 KiB
ArmAsm

// This tests that default-null weak symbols (a GNU extension) are created
// properly via the .weak directive.
// RUN: llvm-mc -filetype=obj -triple i686-pc-win32 %s | llvm-readobj -t | FileCheck %s
// RUN: llvm-mc -filetype=obj -triple x86_64-pc-win32 %s | llvm-readobj -t | FileCheck %s
.def _main;
.scl 2;
.type 32;
.endef
.text
.globl _main
.align 16, 0x90
_main: # @main
# BB#0: # %entry
subl $4, %esp
movl $_test_weak, %eax
testl %eax, %eax
je LBB0_2
# BB#1: # %if.then
call _test_weak
movl $1, %eax
addl $4, %esp
ret
LBB0_2: # %return
xorl %eax, %eax
addl $4, %esp
ret
.weak _test_weak
.weak _test_weak_alias
_test_weak_alias=_main
// CHECK: Symbols [
// CHECK: Symbol {
// CHECK: Name: _test_weak
// CHECK-NEXT: Value: 0
// CHECK-NEXT: Section: (0)
// CHECK-NEXT: BaseType: Null
// CHECK-NEXT: ComplexType: Null
// CHECK-NEXT: StorageClass: WeakExternal
// CHECK-NEXT: AuxSymbolCount: 1
// CHECK-NEXT: AuxWeakExternal {
// CHECK-NEXT: Linked: .weak._test_weak.default
// CHECK-NEXT: Search: Library
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK: Symbol {
// CHECK: Name: .weak._test_weak.default
// CHECK-NEXT: Value: 0
// CHECK-NEXT: Section: (-1)
// CHECK-NEXT: BaseType: Null
// CHECK-NEXT: ComplexType: Null
// CHECK-NEXT: StorageClass: External
// CHECK-NEXT: AuxSymbolCount: 0
// CHECK-NEXT: }
// CHECK: Symbol {
// CHECK: Name: _test_weak_alias
// CHECK-NEXT: Value: 0
// CHECK-NEXT: Section: (0)
// CHECK-NEXT: BaseType: Null
// CHECK-NEXT: ComplexType: Null
// CHECK-NEXT: StorageClass: WeakExternal
// CHECK-NEXT: AuxSymbolCount: 1
// CHECK-NEXT: AuxWeakExternal {
// CHECK-NEXT: Linked: _main
// CHECK-NEXT: Search: Library
// CHECK-NEXT: }
// CHECK-NEXT: }