xref: /netbsd-src/external/gpl3/gcc.old/dist/libphobos/libdruntime/config/common/threadasm.S (revision 4c3eb207d36f67d31994830c0a694161fc1ca39b)
1627f7eb2Smrg/* Support code for fibers and multithreading.
2*4c3eb207Smrg   Copyright (C) 2019-2020 Free Software Foundation, Inc.
3627f7eb2Smrg
4627f7eb2SmrgThis file is part of GCC.
5627f7eb2Smrg
6627f7eb2SmrgGCC is free software; you can redistribute it and/or modify it under
7627f7eb2Smrgthe terms of the GNU General Public License as published by the Free
8627f7eb2SmrgSoftware Foundation; either version 3, or (at your option) any later
9627f7eb2Smrgversion.
10627f7eb2Smrg
11627f7eb2SmrgGCC is distributed in the hope that it will be useful, but WITHOUT ANY
12627f7eb2SmrgWARRANTY; without even the implied warranty of MERCHANTABILITY or
13627f7eb2SmrgFITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14627f7eb2Smrgfor more details.
15627f7eb2Smrg
16627f7eb2SmrgUnder Section 7 of GPL version 3, you are granted additional
17627f7eb2Smrgpermissions described in the GCC Runtime Library Exception, version
18627f7eb2Smrg3.1, as published by the Free Software Foundation.
19627f7eb2Smrg
20627f7eb2SmrgYou should have received a copy of the GNU General Public License and
21627f7eb2Smrga copy of the GCC Runtime Library Exception along with this program;
22627f7eb2Smrgsee the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
23627f7eb2Smrg<http://www.gnu.org/licenses/>.  */
24627f7eb2Smrg
25627f7eb2Smrg#if (__linux__ || __FreeBSD__ || __NetBSD__ || __DragonFly__) && __ELF__
26627f7eb2Smrg/*
27627f7eb2Smrg * Mark the resulting object file as not requiring execution permissions on
28627f7eb2Smrg * stack memory. The absence of this section would mark the whole resulting
29627f7eb2Smrg * library as requiring an executable stack, making it impossible to
30627f7eb2Smrg * dynamically load druntime on several Linux platforms where this is
31627f7eb2Smrg * forbidden due to security policies.
32627f7eb2Smrg */
33627f7eb2Smrg    .section .note.GNU-stack,"",%progbits
34627f7eb2Smrg#endif
35627f7eb2Smrg
36627f7eb2Smrg/* Let preprocessor tell us if C symbols have a prefix: __USER_LABEL_PREFIX__ */
37627f7eb2Smrg#ifdef __USER_LABEL_PREFIX__
38627f7eb2Smrg#define __CONCAT2(a, b) a ## b
39627f7eb2Smrg#define __CONCAT(a, b) __CONCAT2(a, b)
40627f7eb2Smrg#define CSYM(name) __CONCAT(__USER_LABEL_PREFIX__, name)
41627f7eb2Smrg#else
42627f7eb2Smrg#define CSYM(name) name
43627f7eb2Smrg#endif
44