2002-12-27 08:53:07 +00:00
|
|
|
/*
|
2004-04-04 13:46:03 +00:00
|
|
|
* GRUB -- GRand Unified Bootloader
|
2010-01-03 22:05:07 +00:00
|
|
|
* Copyright (C) 1999,2000,2001,2002,2006,2007,2008,2009 Free Software Foundation, Inc.
|
2002-12-27 08:53:07 +00:00
|
|
|
*
|
2007-07-21 23:32:33 +00:00
|
|
|
* GRUB is free software: you can redistribute it and/or modify
|
2002-12-27 08:53:07 +00:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
2007-07-21 23:32:33 +00:00
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
2002-12-27 08:53:07 +00:00
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
2007-07-21 23:32:33 +00:00
|
|
|
* GRUB is distributed in the hope that it will be useful,
|
2002-12-27 08:53:07 +00:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2007-07-21 23:32:33 +00:00
|
|
|
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
2002-12-27 08:53:07 +00:00
|
|
|
*/
|
|
|
|
|
2004-04-04 13:46:03 +00:00
|
|
|
#ifndef GRUB_SYMBOL_HEADER
|
|
|
|
#define GRUB_SYMBOL_HEADER 1
|
2002-12-27 08:53:07 +00:00
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
2009-08-13 06:09:39 +00:00
|
|
|
/* Apple assembler requires local labels to start with a capital L */
|
|
|
|
#define LOCAL(sym) L_ ## sym
|
|
|
|
|
2002-12-27 08:53:07 +00:00
|
|
|
/* Add an underscore to a C symbol in assembler code if needed. */
|
|
|
|
#ifdef HAVE_ASM_USCORE
|
|
|
|
# define EXT_C(sym) _ ## sym
|
|
|
|
#else
|
|
|
|
# define EXT_C(sym) sym
|
|
|
|
#endif
|
|
|
|
|
2009-06-04 21:38:17 +00:00
|
|
|
#if defined (APPLE_CC)
|
|
|
|
#define FUNCTION(x) .globl EXT_C(x) ; EXT_C(x):
|
|
|
|
#define VARIABLE(x) .globl EXT_C(x) ; EXT_C(x):
|
|
|
|
#elif ! defined (__CYGWIN__) && ! defined (__MINGW32__)
|
2005-11-13 21:37:16 +00:00
|
|
|
#define FUNCTION(x) .globl EXT_C(x) ; .type EXT_C(x), "function" ; EXT_C(x):
|
|
|
|
#define VARIABLE(x) .globl EXT_C(x) ; .type EXT_C(x), "object" ; EXT_C(x):
|
2008-07-24 14:56:30 +00:00
|
|
|
#else
|
|
|
|
/* .type not supported for non-ELF targets. XXX: Check this in configure? */
|
|
|
|
#define FUNCTION(x) .globl EXT_C(x) ; .def EXT_C(x); .scl 2; .type 32; .endef; EXT_C(x):
|
|
|
|
#define VARIABLE(x) .globl EXT_C(x) ; .def EXT_C(x); .scl 2; .type 0; .endef; EXT_C(x):
|
|
|
|
#endif
|
2002-12-27 08:53:07 +00:00
|
|
|
|
|
|
|
/* Mark an exported symbol. */
|
2006-04-26 21:58:36 +00:00
|
|
|
#ifndef GRUB_SYMBOL_GENERATOR
|
|
|
|
# define EXPORT_FUNC(x) x
|
|
|
|
# define EXPORT_VAR(x) x
|
|
|
|
#endif /* ! GRUB_SYMBOL_GENERATOR */
|
2002-12-27 08:53:07 +00:00
|
|
|
|
2004-04-04 13:46:03 +00:00
|
|
|
#endif /* ! GRUB_SYMBOL_HEADER */
|