reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced
    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
   36
   37
   38
   39
   40
   41
   42
   43
   44
   45
   46
   47
   48
   49
   50
   51
   52
   53
   54
   55
   56
   57
   58
   59
   60
   61
   62
   63
   64
   65
   66
// RUN: llvm-mc -filetype=obj -triple i686-pc-mingw32 %s | llvm-readobj -S --sr --sd | FileCheck %s

// COFF resolves differences between labels in the same section, unless that
// label is declared with function type.

.section baz, "xr"
	.globl	X
X:
	mov	Y-X+42,	%eax
	retl

	.globl	Y
Y:
	retl

	.def	 _foobar;
	.scl	2;
	.type	32;
	.endef
	.text
	.long   0
	.globl	_foobar
	.align	16, 0x90
_foobar:                                # @foobar
# %bb.0:
	ret

	.globl	_baz
_baz:
	calll	_foobar
	retl

	.data
	.globl	_rust_crate             # @rust_crate
	.align	4
_rust_crate:
	.long   0
	.long   _foobar
	.long	_foobar-_rust_crate
	.long	_foobar-_rust_crate

// Even though _baz and _foobar are in the same .text section, we keep the
// relocation for compatibility with the VC linker's /guard:cf and /incremental
// flags, even on mingw.

// CHECK:        Name: .text
// CHECK:        Relocations [
// CHECK-NEXT:     0x12 IMAGE_REL_I386_REL32 _foobar
// CHECK-NEXT:   ]

// CHECK:        Name: .data
// CHECK:        Relocations [
// CHECK-NEXT:     0x4 IMAGE_REL_I386_DIR32 _foobar
// CHECK-NEXT:     0x8 IMAGE_REL_I386_REL32 _foobar
// CHECK-NEXT:     0xC IMAGE_REL_I386_REL32 _foobar
// CHECK-NEXT:   ]
// CHECK:        SectionData (
// CHECK-NEXT:     0000: 00000000 00000000 0C000000 10000000
// CHECK-NEXT:   )

// CHECK:        Name: baz
// CHECK:        Relocations [
// CHECK-NEXT:   ]
// CHECK:        SectionData (
// CHECK-NEXT:     0000: A1300000 00C3C3
// CHECK-NEXT:   )