Rev 1905 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1905 | Rev 3960 | ||
---|---|---|---|
Line 9... | Line 9... | ||
9 | 9 | ||
10 | #ifndef __MANGLE_H |
10 | #ifndef __MANGLE_H |
Line 11... | Line 11... | ||
11 | #define __MANGLE_H |
11 | #define __MANGLE_H |
- | 12 | ||
Line 12... | Line 13... | ||
12 | 13 | #include "config.h" |
|
13 | #include "config.h" |
14 | #include "intsym.h" |
14 | 15 | ||
15 | #ifdef CCALIGN |
16 | #ifdef CCALIGN |
16 | #define MOVUAPS movaps |
17 | #define MOVUAPS movaps |
Line -... | Line 18... | ||
- | 18 | #else |
|
- | 19 | #define MOVUAPS movups |
|
- | 20 | #endif |
|
- | 21 | ||
- | 22 | /* |
|
- | 23 | ALIGNX: align to X bytes |
|
- | 24 | This differs per compiler/platform in taking the byte count or an exponent for base 2. |
|
- | 25 | A way out is balign, if the assembler supports it (gas extension). |
|
- | 26 | */ |
|
- | 27 | ||
- | 28 | #ifdef ASMALIGN_BALIGN |
|
- | 29 | ||
- | 30 | #define ALIGN4 .balign 4 |
|
- | 31 | #define ALIGN8 .balign 8 |
|
- | 32 | #define ALIGN16 .balign 16 |
|
17 | #else |
33 | #define ALIGN32 .balign 32 |
18 | #define MOVUAPS movups |
34 | |
19 | #endif |
35 | #else |
20 | 36 | ||
21 | #ifdef ASMALIGN_EXP |
37 | #ifdef ASMALIGN_EXP |
22 | #define ALIGN4 .align 2 |
38 | #define ALIGN4 .align 2 |
- | 39 | #define ALIGN8 .align 3 |
|
23 | #define ALIGN8 .align 3 |
40 | #define ALIGN16 .align 4 |
24 | #define ALIGN16 .align 4 |
41 | #define ALIGN32 .align 5 |
25 | #define ALIGN32 .align 5 |
42 | #else |
26 | #else |
43 | #ifdef ASMALIGN_BYTE |
- | 44 | #define ALIGN4 .align 4 |
|
- | 45 | #define ALIGN8 .align 8 |
|
- | 46 | #define ALIGN16 .align 16 |
|
27 | #define ALIGN4 .align 4 |
47 | #define ALIGN32 .align 32 |
Line -... | Line 48... | ||
- | 48 | #else |
|
- | 49 | #error "Dunno how assembler alignment works. Please specify." |
|
- | 50 | #endif |
|
- | 51 | #endif |
|
28 | #define ALIGN8 .align 8 |
52 | |
- | 53 | #endif |
|
- | 54 | ||
- | 55 | #define MANGLE_MACROCAT_REALLY(a, b) a ## b |
|
29 | #define ALIGN16 .align 16 |
56 | #define MANGLE_MACROCAT(a, b) MANGLE_MACROCAT_REALLY(a, b) |
30 | #define ALIGN32 .align 32 |
57 | /* Feel free to add more to the list, eg. a.out IMO */ |
31 | #endif |
58 | #if defined(__USER_LABEL_PREFIX__) |
32 | 59 | #define ASM_NAME(a) MANGLE_MACROCAT(__USER_LABEL_PREFIX__,a) |
|
33 | /* Feel free to add more to the list, eg. a.out IMO */ |
60 | #define ASM_VALUE(a) MANGLE_MACROCAT($,ASM_NAME(a)) |
34 | #if defined(__CYGWIN__) || defined(__MINGW32__) || defined(__OS2__) || defined(_MSC_VER) || \ |
61 | #elif defined(__CYGWIN__) || defined(_WIN32) && !defined (_WIN64) || defined(__OS2__) || \ |
35 | (defined(__OpenBSD__) && !defined(__ELF__)) || defined(__APPLE__) |
62 | (defined(__OpenBSD__) && !defined(__ELF__)) || defined(__APPLE__) |
36 | #define ASM_NAME(a) _##a |
63 | #define ASM_NAME(a) MANGLE_MACROCAT(_,a) |
Line 37... | Line 64... | ||
37 | #define ASM_VALUE(a) $_##a |
64 | #define ASM_VALUE(a) MANGLE_MACROCAT($_,a) |
38 | #else |
65 | #else |
39 | #define ASM_NAME(a) a |
66 | #define ASM_NAME(a) a |
Line 49... | Line 76... | ||
49 | #ifdef __APPLE__ |
76 | #ifdef __APPLE__ |
50 | #define BSS .data |
77 | #define BSS .data |
51 | #else |
78 | #else |
52 | #define BSS .bss |
79 | #define BSS .bss |
53 | #endif |
80 | #endif |
- | 81 | ||
- | 82 | /* Mark non-executable stack. |
|
- | 83 | It's mainly for GNU on Linux... who else does (not) like this? */ |
|
- | 84 | #if !defined(__SUNPRO_C) && defined(__linux__) && defined(__ELF__) |
|
- | 85 | #define NONEXEC_STACK .section .note.GNU-stack,"",%progbits |
|
- | 86 | #else |
|
- | 87 | #define NONEXEC_STACK |
|
- | 88 | #endif |
|
- | 89 | ||
54 | #endif /* !__MANGLE_H */ |
90 | #endif /* !__MANGLE_H */ |