blob: a2f105641ec95a1792c28f50d86c5f83d98ab679 [file] [log] [blame]
sewardjde4a1d02002-03-22 01:27:54 +00001
2/*--------------------------------------------------------------------*/
njn9c533252009-04-24 04:57:07 +00003/*--- Header imported directly by every tool asm file. ---*/
njnc7561b92005-06-19 01:24:32 +00004/*--- pub_tool_basics_asm.h ---*/
sewardjde4a1d02002-03-22 01:27:54 +00005/*--------------------------------------------------------------------*/
njnc7561b92005-06-19 01:24:32 +00006
sewardjde4a1d02002-03-22 01:27:54 +00007/*
njnb9c427c2004-12-01 14:14:42 +00008 This file is part of Valgrind, a dynamic binary instrumentation
9 framework.
sewardjde4a1d02002-03-22 01:27:54 +000010
Elliott Hughesed398002017-06-21 14:41:24 -070011 Copyright (C) 2000-2017 Julian Seward
sewardjde4a1d02002-03-22 01:27:54 +000012 jseward@acm.org
sewardjde4a1d02002-03-22 01:27:54 +000013
14 This program is free software; you can redistribute it and/or
15 modify it under the terms of the GNU General Public License as
16 published by the Free Software Foundation; either version 2 of the
17 License, or (at your option) any later version.
18
19 This program is distributed in the hope that it will be useful, but
20 WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 General Public License for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with this program; if not, write to the Free Software
26 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
27 02111-1307, USA.
28
njn25e49d8e72002-09-23 09:36:25 +000029 The GNU General Public License is contained in the file COPYING.
sewardjde4a1d02002-03-22 01:27:54 +000030*/
31
njnc7561b92005-06-19 01:24:32 +000032#ifndef __PUB_TOOL_BASICS_ASM_H
33#define __PUB_TOOL_BASICS_ASM_H
sewardjde4a1d02002-03-22 01:27:54 +000034
njn9c533252009-04-24 04:57:07 +000035// See pub_tool_basics.h for the purpose of these macros.
36//
37// Note that although the macros here (which are used in asm files) have the
38// same name as those in pub_tool_basics.h (which are used in C files), they
39// have different definitions. Actually, on Linux the definitions are the
40// same, but on Darwin they are different. The reason is that C names on
41// Darwin always get a '_' prepended to them by the compiler. But in order to
42// refer to them from asm code, we have to add the '_' ourselves. Having two
43// versions of these macros makes that difference transparent, so we can use
44// VG_/ML_ in both asm and C files.
45//
46// Note also that the exact prefixes used have to match those used in
47// pub_tool_basics.h.
njn767eb422005-06-10 23:09:45 +000048
njnc7561b92005-06-19 01:24:32 +000049#define VGAPPEND(str1,str2) str1##str2
njn9c533252009-04-24 04:57:07 +000050
sewardj8eb8bab2015-07-21 14:44:28 +000051#if defined(VGO_linux) || defined(VGO_solaris)
njnf76d27a2009-05-28 01:53:07 +000052# define VG_(str) VGAPPEND( vgPlain_, str)
53# define ML_(str) VGAPPEND( vgModuleLocal_, str)
54#elif defined(VGO_darwin)
55# define VG_(str) VGAPPEND(_vgPlain_, str)
56# define ML_(str) VGAPPEND(_vgModuleLocal_, str)
57#else
58# error Unknown OS
59#endif
sewardj7eb7c582005-06-23 01:02:53 +000060
florian3f1d6132015-09-30 20:30:48 +000061/* Let the linker know we don't need an executable stack.
62 The call to MARK_STACK_NO_EXEC should be put unconditionally
63 at the end of all asm source files.
64*/
65#if defined(VGO_linux)
66# if defined(VGA_arm)
67# define MARK_STACK_NO_EXEC .section .note.GNU-stack,"",%progbits
68# else
69# define MARK_STACK_NO_EXEC .section .note.GNU-stack,"",@progbits
70# endif
71#else
72# define MARK_STACK_NO_EXEC
73#endif
74
njnc7561b92005-06-19 01:24:32 +000075#endif /* __PUB_TOOL_BASICS_ASM_H */
nethercotec06e2132004-09-03 13:45:29 +000076
sewardjde4a1d02002-03-22 01:27:54 +000077/*--------------------------------------------------------------------*/
nethercote109d0df2004-09-02 08:10:13 +000078/*--- end ---*/
sewardjde4a1d02002-03-22 01:27:54 +000079/*--------------------------------------------------------------------*/