binutils-gdb/ld/testsuite/ld-pe/weakdef-1.s
Tristan Gingold 1fd6d11190 pe/coff: handle weak defined symbol for gc-sections.
bfd/
	* coffgen.c (_bfd_coff_gc_mark_hook): Handle PE weak
	external symbols with a definition.
	(_bfd_coff_gc_mark_extra_sections): Fix typo.

ld/
	* testsuite/ld-pe/pe.exp: New test.
	* testsuite/ld-pe/weakdef-1.s: New test source.
	* testsuite/ld-pe/weakdef-1.d: New test.
2017-04-07 10:03:17 +02:00

20 lines
267 B
ArmAsm

.weak _wsym
.section .data$wsym,"w"
.align 4
_wsym:
.long 1
.section .text$start,"x"
.globl _start
.def _start; .scl 2; .type 32; .endef
_start:
pushl %ebp
movl %esp, %ebp
movl _wsym, %eax
testl %eax, %eax
sete %al
movzbl %al, %eax
nop
popl %ebp
ret