mpir/yasm/modules/objfmts/elf/tests/gas64/elf_gas64_curpos.asm

28 lines
507 B
NASM
Raw Normal View History

2008-06-15 16:20:16 -04:00
.globl bar
.globl foo
.section .bar
bar:
.4byte foo-.
.4byte baz-.
call foo
call baz
foo:
.section .data
baz:
.4byte foo-.
#.4byte .-foo # illegal
.4byte baz-.
.4byte .-baz
.4byte foo+4-. # with constant
.4byte .-baz+foo+4-. # both local and cross-segment (legal)
#.4byte baz+foo+4-.-. # ditto, slightly different - GAS gets confused on this
#.4byte (bar-.)+(foo-.) # illegal (too many cross-segment)
.4byte baz-.+baz-. # two from same segment
.section .text
movl $5, foo-.
movl $(foo-.), %eax
call foo