Index: kernel/arch/ia32/src/asm.S
===================================================================
--- kernel/arch/ia32/src/asm.S	(revision cfb1217d7123cbca17cad6d3023e7274209f2e89)
+++ kernel/arch/ia32/src/asm.S	(revision a7bd30f29fbc40234dcf8a58c93a43b8fc5ead29)
@@ -31,4 +31,5 @@
  */
 
+#include <abi/asmtool.h>
 #include <arch/pm.h>
 #include <arch/cpu.h>
@@ -37,11 +38,4 @@
 
 .text
-.global paging_on
-.global enable_l_apic_in_msr
-.global memcpy_from_uspace
-.global memcpy_from_uspace_failover_address
-.global memcpy_to_uspace
-.global memcpy_to_uspace_failover_address
-.global early_putchar
 
 #define MEMCPY_DST   4
@@ -64,6 +58,6 @@
  *
  */
-memcpy_from_uspace:
-memcpy_to_uspace:
+FUNCTION_BEGIN(memcpy_from_uspace)
+FUNCTION_BEGIN(memcpy_to_uspace)
 	movl %edi, %edx  /* save %edi */
 	movl %esi, %eax  /* save %esi */
@@ -93,4 +87,6 @@
 		movl MEMCPY_DST(%esp), %eax
 		ret
+FUNCTION_END(memcpy_from_uspace)
+FUNCTION_END(memcpy_to_uspace)
 
 /*
@@ -98,6 +94,6 @@
  * above had caused a page fault.
  */
-memcpy_from_uspace_failover_address:
-memcpy_to_uspace_failover_address:
+SYMBOL(memcpy_from_uspace_failover_address)
+SYMBOL(memcpy_to_uspace_failover_address)
 	movl %edx, %edi
 	movl %eax, %esi
@@ -112,5 +108,5 @@
  *
  */
-paging_on:
+FUNCTION_BEGIN(paging_on)
 	movl %cr0, %edx
 	orl $(1 << 31), %edx  /* paging on */
@@ -123,4 +119,5 @@
 	0:
 		ret
+FUNCTION_END(paging_on)
 
 /** Enable local APIC
@@ -129,5 +126,5 @@
  *
  */
-enable_l_apic_in_msr:
+FUNCTION_BEGIN(enable_l_apic_in_msr)
 	movl $0x1b, %ecx
 	rdmsr
@@ -136,4 +133,5 @@
 	wrmsr
 	ret
+FUNCTION_END(enable_l_apic_in_msr)
 
 /*
@@ -152,6 +150,5 @@
  * entirely in registers.
  */
-.global sysenter_handler
-sysenter_handler:
+SYMBOL(sysenter_handler)
 
 	/*
@@ -232,6 +229,5 @@
  * This is the legacy syscall handler using the interrupt mechanism.
  */
-.global int_syscall
-int_syscall:
+SYMBOL(int_syscall)
 	subl $(ISTATE_SOFT_SIZE + 4), %esp
 
@@ -319,6 +315,5 @@
 
 .macro handler i
-.global int_\i
-int_\i:
+SYMBOL(int_\i)
 	/*
 	 * This macro distinguishes between two versions of ia32
@@ -462,5 +457,5 @@
  *
  */
-early_putchar:
+FUNCTION_BEGIN(early_putchar)
 	
 #if ((defined(CONFIG_EGA)) && (!defined(CONFIG_FB)))
@@ -594,3 +589,4 @@
 	
 	ret
-
+FUNCTION_END(early_putchar)
+
Index: kernel/arch/ia32/src/atomic.S
===================================================================
--- kernel/arch/ia32/src/atomic.S	(revision cfb1217d7123cbca17cad6d3023e7274209f2e89)
+++ kernel/arch/ia32/src/atomic.S	(revision a7bd30f29fbc40234dcf8a58c93a43b8fc5ead29)
@@ -27,14 +27,14 @@
 #
 
+#include <abi/asmtool.h>
+
 .text
 
 #ifdef CONFIG_SMP
 
-.global spinlock_arch
-
 #
 # This is a bus-and-hyperthreading-friendly implementation of spinlock 
 #
-spinlock_arch:
+FUNCTION_BEGIN(spinlock_arch)
 	pushl %eax
 	pushl %ebx
@@ -55,4 +55,5 @@
 	popl %eax
 	ret
+FUNCTION_END(spinlock_arch)
 	
 #endif
Index: kernel/arch/ia32/src/boot/multiboot.S
===================================================================
--- kernel/arch/ia32/src/boot/multiboot.S	(revision cfb1217d7123cbca17cad6d3023e7274209f2e89)
+++ kernel/arch/ia32/src/boot/multiboot.S	(revision a7bd30f29fbc40234dcf8a58c93a43b8fc5ead29)
@@ -29,4 +29,5 @@
  */
 
+#include <abi/asmtool.h>
 #include <arch/boot/boot.h>
 #include <arch/mm/page.h>
@@ -61,5 +62,4 @@
 
 .align 4
-.global multiboot_image_start
 multiboot_header:
 	.long MULTIBOOT_HEADER_MAGIC
@@ -72,5 +72,5 @@
 	.long multiboot_image_start
 
-multiboot_image_start:
+SYMBOL(multiboot_image_start)
 	cli
 	cld
@@ -162,5 +162,5 @@
  *
  */
-.global map_kernel_pse
+FUNCTION_BEGIN(map_kernel_pse)
 map_kernel_pse:
 	/* Paging features */
@@ -194,4 +194,5 @@
 	movl %ebx, %cr0
 	ret
+FUNCTION_END(map_kernel_pse)
 
 /** Setup mapping for the kernel (non-PSE variant).
@@ -201,6 +202,5 @@
  *
  */
-.global map_kernel_non_pse
-map_kernel_non_pse:
+FUNCTION_BEGIN(map_kernel_non_pse)
 	/* Paging features */
 	movl %cr4, %ecx
@@ -281,4 +281,5 @@
 		
 		ret
+FUNCTION_END(map_kernel_non_pse)
 
 /** Calculate unmapped address of the end of the kernel. */
@@ -707,20 +708,16 @@
 	.space 4096, 0
 
-.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/ia32/src/boot/multiboot2.S
===================================================================
--- kernel/arch/ia32/src/boot/multiboot2.S	(revision cfb1217d7123cbca17cad6d3023e7274209f2e89)
+++ kernel/arch/ia32/src/boot/multiboot2.S	(revision a7bd30f29fbc40234dcf8a58c93a43b8fc5ead29)
@@ -27,4 +27,5 @@
  */
 
+#include <abi/asmtool.h>
 #include <arch/boot/boot.h>
 #include <arch/pm.h>
@@ -39,5 +40,4 @@
 
 .align 8
-.global multiboot2_image_start
 multiboot2_header_start:
 	.long MULTIBOOT2_HEADER_MAGIC
@@ -120,5 +120,5 @@
 multiboot2_header_end:
 
-multiboot2_image_start:
+SYMBOL(multiboot2_image_start)
 	cli
 	cld
Index: kernel/arch/ia32/src/context.S
===================================================================
--- kernel/arch/ia32/src/context.S	(revision cfb1217d7123cbca17cad6d3023e7274209f2e89)
+++ kernel/arch/ia32/src/context.S	(revision a7bd30f29fbc40234dcf8a58c93a43b8fc5ead29)
@@ -27,11 +27,8 @@
 #
 
+#include <abi/asmtool.h>
 #include <arch/context_struct.h>
 
 .text
-
-.global context_save_arch
-.global context_restore_arch
-
 
 ## Save current CPU context
@@ -40,5 +37,5 @@
 # pointed by the 1st argument. Returns 1 in EAX.
 #
-context_save_arch:
+FUNCTION_BEGIN(context_save_arch)
 	movl 0(%esp), %eax	# save pc value into eax	
 	movl 4(%esp), %edx	# address of the context variable to save context to 
@@ -55,4 +52,5 @@
 	incl %eax
 	ret
+FUNCTION_END(context_save_arch)
 
 
@@ -62,5 +60,5 @@
 # pointed by the 1st argument. Returns 0 in EAX.
 #
-context_restore_arch:
+FUNCTION_BEGIN(context_restore_arch)
 	movl 4(%esp), %eax	# address of the context variable to restore context from
 
@@ -76,3 +74,3 @@
 	xorl %eax, %eax		# context_restore returns 0
 	ret
-
+FUNCTION_END(context_restore_arch)
Index: kernel/arch/ia32/src/debug/stacktrace_asm.S
===================================================================
--- kernel/arch/ia32/src/debug/stacktrace_asm.S	(revision cfb1217d7123cbca17cad6d3023e7274209f2e89)
+++ kernel/arch/ia32/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)
 	movl %ebp, %eax
 	ret
+FUNCTION_END(frame_pointer_get)
 
-program_counter_get:
+FUNCTION_BEGIN(program_counter_get)
 	movl (%esp), %eax
 	ret
+FUNCTION_END(program_counter_get)
Index: kernel/arch/ia32/src/delay.S
===================================================================
--- kernel/arch/ia32/src/delay.S	(revision a7bd30f29fbc40234dcf8a58c93a43b8fc5ead29)
+++ kernel/arch/ia32/src/delay.S	(revision a7bd30f29fbc40234dcf8a58c93a43b8fc5ead29)
@@ -0,0 +1,52 @@
+#
+# Copyright (c) 2001-2004 Jakub Jermar
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# - Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# - Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in the
+#   documentation and/or other materials provided with the distribution.
+# - The name of the author may not be used to endorse or promote products
+#   derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+#
+# Micro second delay loop functions.
+#
+
+#include <abi/asmtool.h>
+
+.text
+
+FUNCTION_BEGIN(asm_delay_loop)
+	movl 4(%esp),%ecx	# move argument to %ecx
+0:	lahf
+	dec %ecx
+	jnz 0b
+	ret
+FUNCTION_END(asm_delay_loop)
+
+FUNCTION_BEGIN(asm_fake_loop)
+	movl 4(%esp),%ecx	# move argument to %ecx
+0:	lahf
+	dec %ecx
+	jz 0b
+	ret
+FUNCTION_END(asm_fake_loop)
+
Index: kernel/arch/ia32/src/delay.s
===================================================================
--- kernel/arch/ia32/src/delay.s	(revision cfb1217d7123cbca17cad6d3023e7274209f2e89)
+++ 	(revision )
@@ -1,50 +1,0 @@
-#
-# Copyright (c) 2001-2004 Jakub Jermar
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# - Redistributions of source code must retain the above copyright
-#   notice, this list of conditions and the following disclaimer.
-# - Redistributions in binary form must reproduce the above copyright
-#   notice, this list of conditions and the following disclaimer in the
-#   documentation and/or other materials provided with the distribution.
-# - The name of the author may not be used to endorse or promote products
-#   derived from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-
-#
-# Micro second delay loop functions.
-#
-
-.text
-
-.global asm_delay_loop
-.global asm_fake_loop
-
-asm_delay_loop:
-	movl 4(%esp),%ecx	# move argument to %ecx
-0:	lahf
-	dec %ecx
-	jnz 0b
-	ret
-
-asm_fake_loop:
-	movl 4(%esp),%ecx	# move argument to %ecx
-0:	lahf
-	dec %ecx
-	jz 0b
-	ret
Index: kernel/arch/ia32/src/smp/ap.S
===================================================================
--- kernel/arch/ia32/src/smp/ap.S	(revision cfb1217d7123cbca17cad6d3023e7274209f2e89)
+++ kernel/arch/ia32/src/smp/ap.S	(revision a7bd30f29fbc40234dcf8a58c93a43b8fc5ead29)
@@ -32,4 +32,5 @@
  */
 
+#include <abi/asmtool.h>
 #include <arch/boot/boot.h>
 #include <arch/boot/memmap.h>
@@ -40,6 +41,4 @@
 
 #ifdef CONFIG_SMP
-
-.global unmapped_ap_boot
 
 KTEXT=8
@@ -53,5 +52,5 @@
 
 .align 4096
-unmapped_ap_boot:
+SYMBOL(unmapped_ap_boot)
 .code16
 	cli
@@ -99,7 +98,5 @@
 #ifdef CONFIG_SMP
 
-.global unmapped_ap_gdtr
-
-unmapped_ap_gdtr:
+SYMBOL(unmapped_ap_gdtr)
 	.word 0
 	.long 0
