Index: kernel/arch/ia64/Makefile.inc
===================================================================
--- kernel/arch/ia64/Makefile.inc	(revision 054476d01aca9bd28135fce64c7c46d84fe7398c)
+++ kernel/arch/ia64/Makefile.inc	(revision 27f67f53b292b6b11b45be192ec9f6146a87fd85)
@@ -43,5 +43,5 @@
 	arch/$(KARCH)/src/start.S \
 	arch/$(KARCH)/src/asm.S \
-	arch/$(KARCH)/src/dummy.s \
+	arch/$(KARCH)/src/dummy.S \
 	arch/$(KARCH)/src/ia64.c \
 	arch/$(KARCH)/src/fpu_context.c \
Index: kernel/arch/ia64/src/asm.S
===================================================================
--- kernel/arch/ia64/src/asm.S	(revision 054476d01aca9bd28135fce64c7c46d84fe7398c)
+++ kernel/arch/ia64/src/asm.S	(revision 27f67f53b292b6b11b45be192ec9f6146a87fd85)
@@ -27,11 +27,8 @@
  */
 
+#include <abi/asmtool.h>
 #include <arch/register.h>
 
 .text
-.global memcpy_from_uspace
-.global memcpy_to_uspace
-.global memcpy_from_uspace_failover_address
-.global memcpy_to_uspace_failover_address
 
 /** Copy memory from/to userspace.
@@ -46,6 +43,6 @@
  *
  */
-memcpy_from_uspace:
-memcpy_to_uspace:
+FUNCTION_BEGIN(memcpy_from_uspace)
+FUNCTION_BEGIN(memcpy_to_uspace)
 	alloc loc0 = ar.pfs, 3, 1, 0, 0
 	
@@ -132,7 +129,9 @@
 		mov ar.pfs = loc0
 		br.ret.sptk.many rp
+FUNCTION_END(memcpy_from_uspace)
+FUNCTION_END(memcpy_to_uspace)
 
-memcpy_from_uspace_failover_address:
-memcpy_to_uspace_failover_address:
+SYMBOL(memcpy_from_uspace_failover_address)
+SYMBOL(memcpy_to_uspace_failover_address)
 	/* Return 0 on failure */
 	mov r8 = r0
@@ -140,7 +139,7 @@
 	br.ret.sptk.many rp
 
-.global cpu_halt
-cpu_halt:
+FUNCTION_BEGIN(cpu_halt)
 	br cpu_halt
+FUNCTION_END(cpu_halt)
 
 /** Switch to userspace - low level code.
@@ -154,6 +153,5 @@
  *
  */
-.global switch_to_userspace
-switch_to_userspace:
+FUNCTION_BEGIN(switch_to_userspace)
 	alloc loc0 = ar.pfs, 6, 3, 0, 0
 	
@@ -191,6 +189,7 @@
 	
 	rfi ;;
+FUNCTION_END(switch_to_userspace)
 
-.global early_putchar
-early_putchar:
+FUNCTION_BEGIN(early_putchar)
 	br.ret.sptk.many b0
+FUNCTION_END(early_putchar)
Index: kernel/arch/ia64/src/context.S
===================================================================
--- kernel/arch/ia64/src/context.S	(revision 054476d01aca9bd28135fce64c7c46d84fe7398c)
+++ kernel/arch/ia64/src/context.S	(revision 27f67f53b292b6b11b45be192ec9f6146a87fd85)
@@ -27,12 +27,10 @@
 #
 
+#include <abi/asmtool.h>
 #include <arch/context_struct.h>
 
 .text
 
-.global context_save_arch
-.global context_restore_arch
-
-context_save_arch:
+FUNCTION_BEGIN(context_save_arch)
 	alloc loc0 = ar.pfs, 1, 49, 0, 0
 	mov loc1 = ar.unat ;;
@@ -182,6 +180,7 @@
 	add r8 = r0, r0, 1 	/* context_save returns 1 */
 	br.ret.sptk.many b0
-
-context_restore_arch:
+FUNCTION_END(context_save_arch)
+
+FUNCTION_BEGIN(context_restore_arch)
 	alloc loc0 = ar.pfs, 1, 50, 0, 0	;;
 
@@ -338,3 +337,4 @@
 	mov r8 = r0			/* context_restore returns 0 */
 	br.ret.sptk.many b0
-
+FUNCTION_END(context_restore_arch)
+
Index: kernel/arch/ia64/src/debug/stacktrace_asm.S
===================================================================
--- kernel/arch/ia64/src/debug/stacktrace_asm.S	(revision 054476d01aca9bd28135fce64c7c46d84fe7398c)
+++ kernel/arch/ia64/src/debug/stacktrace_asm.S	(revision 27f67f53b292b6b11b45be192ec9f6146a87fd85)
@@ -27,14 +27,16 @@
 #
 
+#include <abi/asmtool.h>
+
 .text
 
-.global frame_pointer_get
-.global program_counter_get
-
-frame_pointer_get:
+FUNCTION_BEGIN(frame_pointer_get)
 	mov r8 = r0
 	br.ret.sptk.many b0
+FUNCTION_END(frame_pointer_get)
 
-program_counter_get:
+FUNCTION_BEGIN(program_counter_get)
 	mov r8 = r0
 	br.ret.sptk.many b0
+FUNCTION_END(program_counter_get)
+
Index: kernel/arch/ia64/src/dummy.S
===================================================================
--- kernel/arch/ia64/src/dummy.S	(revision 27f67f53b292b6b11b45be192ec9f6146a87fd85)
+++ kernel/arch/ia64/src/dummy.S	(revision 27f67f53b292b6b11b45be192ec9f6146a87fd85)
@@ -0,0 +1,40 @@
+#
+# Copyright (c) 2005 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.
+#
+
+#include <abi/asmtool.h>
+
+.text
+
+FUNCTION_BEGIN(calibrate_delay_loop)
+FUNCTION_BEGIN(asm_delay_loop)
+FUNCTION_BEGIN(cpu_sleep)
+	br.ret.sptk.many b0
+FUNCTION_END(calibrate_delay_loop)
+FUNCTION_END(asm_delay_loop)
+FUNCTION_END(cpu_sleep)
+
Index: kernel/arch/ia64/src/dummy.s
===================================================================
--- kernel/arch/ia64/src/dummy.s	(revision 054476d01aca9bd28135fce64c7c46d84fe7398c)
+++ 	(revision )
@@ -1,42 +1,0 @@
-#
-# Copyright (c) 2005 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.
-#
-
-.text
-
-.global calibrate_delay_loop
-.global asm_delay_loop
-.global cpu_sleep
-.global dummy
-
-calibrate_delay_loop:
-asm_delay_loop:
-cpu_sleep:
-
-dummy:
-	br.ret.sptk.many b0
-
Index: kernel/arch/ia64/src/ivt.S
===================================================================
--- kernel/arch/ia64/src/ivt.S	(revision 054476d01aca9bd28135fce64c7c46d84fe7398c)
+++ kernel/arch/ia64/src/ivt.S	(revision 27f67f53b292b6b11b45be192ec9f6146a87fd85)
@@ -28,4 +28,5 @@
 #
 
+#include <abi/asmtool.h>
 #include <arch/stack.h>
 #include <arch/register.h>
@@ -101,6 +102,5 @@
 .endm
 
-.global heavyweight_handler
-heavyweight_handler:
+SYMBOL(heavyweight_handler)
     /* 1. copy interrupt registers into bank 0 */
     
@@ -297,6 +297,5 @@
 	rfi ;;
 
-.global heavyweight_handler_inner
-heavyweight_handler_inner:
+FUNCTION_BEGIN(heavyweight_handler_inner)
 	/*
 	 * From this point, the rest of the interrupted context
@@ -538,8 +537,8 @@
 	mov ar.pfs = loc0
 	br.ret.sptk.many b0
-
-.global ivt
+FUNCTION_END(heavyweight_handler_inner)
+
 .align 32768
-ivt:
+SYMBOL(ivt)
 	HEAVYWEIGHT_HANDLER 0x00
 	HEAVYWEIGHT_HANDLER 0x04
Index: kernel/arch/ia64/src/start.S
===================================================================
--- kernel/arch/ia64/src/start.S	(revision 054476d01aca9bd28135fce64c7c46d84fe7398c)
+++ kernel/arch/ia64/src/start.S	(revision 27f67f53b292b6b11b45be192ec9f6146a87fd85)
@@ -27,4 +27,5 @@
 #
 
+#include <abi/asmtool.h>
 #include <arch/register.h>
 #include <arch/mm/page.h>
@@ -41,6 +42,4 @@
 .section K_TEXT_START, "ax"
 
-.global kernel_image_start
-
 stack0:
 
@@ -53,5 +52,5 @@
 #	r2	Address of the boot code's bootinfo structure.
 #
-kernel_image_start:
+SYMBOL(kernel_image_start)
 	.auto
 	
@@ -113,5 +112,4 @@
 	rfi ;;
 
-.global paging_start
 paging_start:
 	
