This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] reformatting patch for FreeBSD/sparc64
- From: "David O'Brien" <obrien at FreeBSD dot org>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 31 Oct 2002 17:07:57 -0800
- Subject: [PATCH] reformatting patch for FreeBSD/sparc64
- Organization: The NUXI BSD Group
- Reply-to: obrien at FreeBSD dot org
I find this version easier to read and would like to commit it.
2002-10-31 David O'Brien <obrien@FreeBSD.org>
* config/sparc/freebsd.h (TRANSFER_FROM_TRAMPOLINE): Reformat.
Index: config/sparc/freebsd.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/sparc/freebsd.h,v
retrieving revision 1.13
diff -u -r1.13 freebsd.h
--- config/sparc/freebsd.h 31 Oct 2002 09:08:11 -0000 1.13
+++ config/sparc/freebsd.h 1 Nov 2002 01:06:32 -0000
@@ -97,35 +97,29 @@
#define SPARC_DEFAULT_CMODEL CM_MEDLOW
#define TRANSFER_FROM_TRAMPOLINE \
-static int need_enable_exec_stack; \
+ static int need_enable_exec_stack; \
+ static void check_enabling(void) __attribute__ ((constructor)); \
+ static void check_enabling(void) \
+ { \
+ extern int sysctlbyname(const char *, void *, size_t *, void *, size_t);\
+ int prot = 0; \
+ size_t len = sizeof(prot); \
\
-static void check_enabling(void) __attribute__ ((constructor)); \
-static void check_enabling(void) \
-{ \
- extern int sysctlbyname(const char *, void *, size_t *, void *, size_t);\
- size_t len; \
- int prot; \
- \
- prot = 0; \
- len = sizeof(prot); \
- sysctlbyname ("kern.stackprot", &prot, &len, NULL, 0); \
- if (prot != 7) \
- need_enable_exec_stack = 1; \
-} \
- \
-extern void __enable_execute_stack (void *); \
-void \
-__enable_execute_stack (addr) \
- void *addr; \
-{ \
- if (!need_enable_exec_stack) \
- return; \
- else { \
- /* 7 is PROT_READ | PROT_WRITE | PROT_EXEC */ \
- if (mprotect (addr, TRAMPOLINE_SIZE, 7) < 0) \
- perror ("mprotect of trampoline code"); \
+ sysctlbyname ("kern.stackprot", &prot, &len, NULL, 0); \
+ if (prot != 7) \
+ need_enable_exec_stack = 1; \
} \
-}
+ extern void __enable_execute_stack (void *); \
+ void __enable_execute_stack (void *addr) \
+ { \
+ if (!need_enable_exec_stack) \
+ return; \
+ else { \
+ /* 7 is PROT_READ | PROT_WRITE | PROT_EXEC */ \
+ if (mprotect (addr, TRAMPOLINE_SIZE, 7) < 0) \
+ perror ("mprotect of trampoline code"); \
+ } \
+ }