nasm/test/elf_visibility.asm
H. Peter Anvin e47f4b7ad5 elf: fix "object" symbol keyword
The "object" symbol keyword would incorrectly generate STT_NOTYPE
instead of STT_OBJECT. Add test for weak object references; they are
different from plain weak references in that they are guaranteed to
resolve to zero if the symbol is not found.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2019-09-12 17:45:11 -07:00

31 lines
528 B
NASM

global foo:(foo_end - foo)
global foo_hidden:function hidden
global foo_protected:function protected
global foo_internal:function internal
global foo_weak:function weak
global foo_hidden_weak:function hidden weak
extern strong_ref, weak_ref:weak, unused_ref
extern weak_object_ref:weak object
required required_ref
SECTION .text align=16
foo:
nop
foo_hidden:
nop
foo_protected:
nop
foo_internal:
nop
foo_weak:
ret
foo_hidden_weak:
mov eax,weak_ref
mov eax,strong_ref
mov eax,weak_object_ref
foo_label:
ret
foo_end: