Index: kernel/arch/amd64/src/asm.S
===================================================================
--- kernel/arch/amd64/src/asm.S	(revision cfb1217d7123cbca17cad6d3023e7274209f2e89)
+++ kernel/arch/amd64/src/asm.S	(revision a7bd30f29fbc40234dcf8a58c93a43b8fc5ead29)
@@ -27,4 +27,5 @@
  */
 
+#include <abi/asmtool.h>
 #include <arch/pm.h>
 #include <arch/mm/page.h>
@@ -32,15 +33,4 @@
 
 .text
-.global interrupt_handlers
-.global syscall_entry
-.global cpuid
-.global has_cpuid
-.global read_efer_flag
-.global set_efer_flag
-.global memcpy_from_uspace
-.global memcpy_to_uspace
-.global memcpy_from_uspace_failover_address
-.global memcpy_to_uspace_failover_address
-.global early_putchar
 
 #define MEMCPY_DST   %rdi
@@ -64,6 +54,6 @@
  *
  */
-memcpy_from_uspace:
-memcpy_to_uspace:
+FUNCTION_BEGIN(memcpy_from_uspace)
+FUNCTION_BEGIN(memcpy_to_uspace)
 	movq MEMCPY_DST, %rax
 	
@@ -81,7 +71,9 @@
 	0:
 		ret                 /* return MEMCPY_SRC, success */
-
-memcpy_from_uspace_failover_address:
-memcpy_to_uspace_failover_address:
+FUNCTION_END(memcpy_from_uspace)
+FUNCTION_END(memcpy_to_uspace)
+
+SYMBOL(memcpy_from_uspace_failover_address)
+SYMBOL(memcpy_to_uspace_failover_address)
 	xorl %eax, %eax         /* return 0, failure */
 	ret
@@ -92,5 +84,5 @@
 *
 */
-has_cpuid:
+FUNCTION_BEGIN(has_cpuid)
 	/* Load RFLAGS */
 	pushfq
@@ -114,6 +106,7 @@
 	xorl %edx, %eax
 	ret
-
-cpuid:
+FUNCTION_END(has_cpuid)
+
+FUNCTION_BEGIN(cpuid)
 	/* Preserve %rbx across function calls */
 	movq %rbx, %r10
@@ -130,6 +123,7 @@
 	movq %r10, %rbx
 	ret
-
-set_efer_flag:
+FUNCTION_END(cpuid)
+
+FUNCTION_BEGIN(set_efer_flag)
 	movl $0xc0000080, %ecx
 	rdmsr
@@ -137,9 +131,11 @@
 	wrmsr
 	ret
-
-read_efer_flag:
+FUNCTION_END(set_efer_flag)
+
+FUNCTION_BEGIN(read_efer_flag)
 	movl $0xc0000080, %ecx
 	rdmsr
 	ret
+FUNCTION_END(read_efer_flag)
 
 /*
@@ -157,6 +153,5 @@
 
 .macro handler i
-.global int_\i
-int_\i:
+SYMBOL(int_\i)
 
 	/*
@@ -249,5 +244,5 @@
 	53,54,55,56,57,58,59,60,61,62,63
 
-interrupt_handlers:
+SYMBOL(interrupt_handlers)
 .irp cnt, LIST_0_63
 	handler \cnt 
@@ -273,5 +268,5 @@
  *
  */
-syscall_entry:
+SYMBOL(syscall_entry)
 	/* Switch to hidden %gs */
 	swapgs
@@ -396,6 +391,5 @@
  *
  */
-early_putchar:
-	
+FUNCTION_BEGIN(early_putchar)
 #if ((defined(CONFIG_EGA)) && (!defined(CONFIG_FB)))
 	
@@ -525,3 +519,4 @@
 	
 	ret
-
+FUNCTION_END(early_putchar)
+
Index: kernel/arch/amd64/src/boot/multiboot.S
===================================================================
--- kernel/arch/amd64/src/boot/multiboot.S	(revision cfb1217d7123cbca17cad6d3023e7274209f2e89)
+++ kernel/arch/amd64/src/boot/multiboot.S	(revision a7bd30f29fbc40234dcf8a58c93a43b8fc5ead29)
@@ -29,4 +29,5 @@
  */
 
+#include <abi/asmtool.h>
 #include <arch/boot/boot.h>
 #include <arch/mm/page.h>
@@ -64,5 +65,4 @@
 
 .align 4
-.global multiboot_image_start
 multiboot_header:
 	.long MULTIBOOT_HEADER_MAGIC
@@ -75,5 +75,5 @@
 	.long multiboot_image_start
 
-multiboot_image_start:
+SYMBOL(multiboot_image_start)
 	cli
 	cld
@@ -640,6 +640,5 @@
 
 .align 4096
-.global ptl_0
-ptl_0:
+SYMBOL(ptl_0)
 	.quad ptl_1 + (PTL_WRITABLE | PTL_PRESENT)
 	.fill 510, 8, 0
@@ -648,20 +647,16 @@
 .section K_DATA_START, "aw", @progbits
 
-.global bootstrap_idtr
-bootstrap_idtr:
+SYMBOL(bootstrap_idtr)
 	.word 0
 	.long 0
 
-.global bootstrap_gdtr
-bootstrap_gdtr:
+SYMBOL(bootstrap_gdtr)
 	.word GDT_SELECTOR(GDT_ITEMS)
 	.long KA2PA(gdt)
 
-.global multiboot_eax
-multiboot_eax:
+SYMBOL(multiboot_eax)
 	.long 0
 
-.global multiboot_ebx
-multiboot_ebx:
+SYMBOL(multiboot_ebx)
 	.long 0
 
Index: kernel/arch/amd64/src/boot/multiboot2.S
===================================================================
--- kernel/arch/amd64/src/boot/multiboot2.S	(revision cfb1217d7123cbca17cad6d3023e7274209f2e89)
+++ kernel/arch/amd64/src/boot/multiboot2.S	(revision a7bd30f29fbc40234dcf8a58c93a43b8fc5ead29)
@@ -27,4 +27,5 @@
  */
 
+#include <abi/asmtool.h>
 #include <arch/boot/boot.h>
 #include <arch/mm/page.h>
@@ -41,5 +42,4 @@
 
 .align 8
-.global multiboot2_image_start
 multiboot2_header_start:
 	.long MULTIBOOT2_HEADER_MAGIC
@@ -122,5 +122,5 @@
 multiboot2_header_end:
 
-multiboot2_image_start:
+SYMBOL(multiboot2_image_start)
 	cli
 	cld
Index: kernel/arch/amd64/src/context.S
===================================================================
--- kernel/arch/amd64/src/context.S	(revision cfb1217d7123cbca17cad6d3023e7274209f2e89)
+++ kernel/arch/amd64/src/context.S	(revision a7bd30f29fbc40234dcf8a58c93a43b8fc5ead29)
@@ -27,10 +27,8 @@
 #
 
+#include <abi/asmtool.h>
+#include <arch/context_struct.h>
+
 .text
-
-.global context_save_arch
-.global context_restore_arch
-
-#include <arch/context_struct.h>
 
 ## Save current CPU context
@@ -39,5 +37,5 @@
 # pointed by the 1st argument. Returns 1 in EAX.
 #
-context_save_arch:
+FUNCTION_BEGIN(context_save_arch)
 	movq (%rsp), %rdx     # the caller's return %eip
 	
@@ -56,4 +54,5 @@
 	incl %eax
 	ret
+FUNCTION_END(context_save_arch)
 
 
@@ -63,5 +62,5 @@
 # pointed by the 1st argument. Returns 0 in EAX.
 #
-context_restore_arch:
+FUNCTION_BEGIN(context_restore_arch)
 	movq CONTEXT_OFFSET_R15(%rdi), %r15
 	movq CONTEXT_OFFSET_R14(%rdi), %r14
@@ -79,3 +78,4 @@
 	xorl %eax, %eax       # context_restore returns 0
 	ret
+FUNCTION_END(context_restore_arch)
 
Index: kernel/arch/amd64/src/debug/stacktrace_asm.S
===================================================================
--- kernel/arch/amd64/src/debug/stacktrace_asm.S	(revision cfb1217d7123cbca17cad6d3023e7274209f2e89)
+++ kernel/arch/amd64/src/debug/stacktrace_asm.S	(revision a7bd30f29fbc40234dcf8a58c93a43b8fc5ead29)
@@ -27,14 +27,15 @@
 #
 
+#include <abi/asmtool.h>
+
 .text
 
-.global frame_pointer_get
-.global program_counter_get
-
-frame_pointer_get:
+FUNCTION_BEGIN(frame_pointer_get)
 	movq %rbp, %rax
 	ret
+FUNCTION_END(frame_pointer_get)
 
-program_counter_get:
+FUNCTION_BEGIN(program_counter_get)
 	movq (%rsp), %rax
 	ret
+FUNCTION_END(program_counter_get)
Index: kernel/arch/amd64/src/delay.S
===================================================================
--- kernel/arch/amd64/src/delay.S	(revision cfb1217d7123cbca17cad6d3023e7274209f2e89)
+++ kernel/arch/amd64/src/delay.S	(revision a7bd30f29fbc40234dcf8a58c93a43b8fc5ead29)
@@ -31,10 +31,9 @@
 #
 
+#include <abi/asmtool.h>
+
 .text
 
-.global asm_delay_loop
-.global asm_fake_loop
-
-asm_delay_loop:
+FUNCTION_BEGIN(asm_delay_loop)
 	0:
 		dec %rdi
@@ -42,6 +41,7 @@
 	
 	ret
+FUNCTION_END(asm_delay_loop)
 
-asm_fake_loop:
+FUNCTION_BEGIN(asm_fake_loop)
 	0:
 		dec %rdi
@@ -49,2 +49,4 @@
 	
 	ret
+FUNCTION_END(asm_fake_loop)
+
Index: kernel/arch/amd64/src/smp/ap.S
===================================================================
--- kernel/arch/amd64/src/smp/ap.S	(revision cfb1217d7123cbca17cad6d3023e7274209f2e89)
+++ kernel/arch/amd64/src/smp/ap.S	(revision a7bd30f29fbc40234dcf8a58c93a43b8fc5ead29)
@@ -32,4 +32,5 @@
 #
 
+#include <abi/asmtool.h>
 #include <arch/boot/boot.h>
 #include <arch/boot/memmap.h>
@@ -43,6 +44,4 @@
 #ifdef CONFIG_SMP
 
-.global unmapped_ap_boot
-
 # This piece of code is real-mode and is meant to be alligned at 4K boundary.
 # The requirement for such an alignment comes from MP Specification's STARTUP
@@ -50,5 +49,5 @@
 
 .align 4096
-unmapped_ap_boot:
+SYMBOL(unmapped_ap_boot)
 .code16
 	cli
@@ -113,6 +112,5 @@
 #ifdef CONFIG_SMP
 
-.global unmapped_ap_gdtr
-unmapped_ap_gdtr:
+SYMBOL(unmapped_ap_gdtr)
 	.word 0
 	.long 0
