diff options
author | Jakub Jelinek <jakub@redhat.com> | 2003-06-04 18:44:51 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2003-06-04 18:44:51 +0200 |
commit | 3edc56a9e5499b79239967350162066d99eaf95a (patch) | |
tree | 183ccc7e9327b3b5ce962ea21bd520f0b9da84dc /gcc | |
parent | d2c49530bb30888afa711911c98fc8d9bf6ee380 (diff) | |
download | gcc-3edc56a9e5499b79239967350162066d99eaf95a.zip gcc-3edc56a9e5499b79239967350162066d99eaf95a.tar.gz gcc-3edc56a9e5499b79239967350162066d99eaf95a.tar.bz2 |
function.c (trampolines_created): New variable.
* function.c (trampolines_created): New variable.
(expand_function_end): Set it when doing INITIALIZE_TRAMPOLINE.
* function.h (trampolines_created): Add.
* config/s390/linux.h (ASM_FILE_END): Define.
* config/alpha/linux-elf.h (ASM_FILE_END): Define.
* config/m68k/linux.h (ASM_FILE_END): Define.
* config/rs6000/linux.h (ASM_FILE_END): Define.
* config/rs6000/linux64.h (ASM_FILE_END): Define.
* config/rs6000/ppc-asm.h: Add .note.GNU-stack on powerpc-linux.
* config/sparc/linux.h (ASM_FILE_END): Define.
* config/sparc/linux64.h (ASM_FILE_END): Define.
* config/i386/i386.c (ix86_asm_file_end): Use SUBTARGET_FILE_END.
* config/i386/linux.h (SUBTARGET_FILE_END): Define.
* config/i386/linux64.h (SUBTARGET_FILE_END): Define.
From-SVN: r67447
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 17 | ||||
-rw-r--r-- | gcc/config/alpha/linux-elf.h | 7 | ||||
-rw-r--r-- | gcc/config/i386/i386.c | 4 | ||||
-rw-r--r-- | gcc/config/i386/linux.h | 7 | ||||
-rw-r--r-- | gcc/config/i386/linux64.h | 7 | ||||
-rw-r--r-- | gcc/config/m68k/linux.h | 7 | ||||
-rw-r--r-- | gcc/config/rs6000/linux.h | 7 | ||||
-rw-r--r-- | gcc/config/rs6000/linux64.h | 8 | ||||
-rw-r--r-- | gcc/config/rs6000/ppc-asm.h | 5 | ||||
-rw-r--r-- | gcc/config/s390/linux.h | 6 | ||||
-rw-r--r-- | gcc/config/sparc/linux.h | 7 | ||||
-rw-r--r-- | gcc/config/sparc/linux64.h | 7 | ||||
-rw-r--r-- | gcc/function.c | 4 | ||||
-rw-r--r-- | gcc/function.h | 3 |
14 files changed, 96 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 96a0ab8..6bb5c6a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,20 @@ +2003-06-04 Jakub Jelinek <jakub@redhat.com> + + * function.c (trampolines_created): New variable. + (expand_function_end): Set it when doing INITIALIZE_TRAMPOLINE. + * function.h (trampolines_created): Add. + * config/s390/linux.h (ASM_FILE_END): Define. + * config/alpha/linux-elf.h (ASM_FILE_END): Define. + * config/m68k/linux.h (ASM_FILE_END): Define. + * config/rs6000/linux.h (ASM_FILE_END): Define. + * config/rs6000/linux64.h (ASM_FILE_END): Define. + * config/rs6000/ppc-asm.h: Add .note.GNU-stack on powerpc-linux. + * config/sparc/linux.h (ASM_FILE_END): Define. + * config/sparc/linux64.h (ASM_FILE_END): Define. + * config/i386/i386.c (ix86_asm_file_end): Use SUBTARGET_FILE_END. + * config/i386/linux.h (SUBTARGET_FILE_END): Define. + * config/i386/linux64.h (SUBTARGET_FILE_END): Define. + Wed Jun 4 18:39:33 CEST 2003 Jan Hubicka <jh@suse.cz> * i386.c (min_insn_size, k8_avoid_jump_misspredicts): New functions diff --git a/gcc/config/alpha/linux-elf.h b/gcc/config/alpha/linux-elf.h index be17ddd..c7319f3 100644 --- a/gcc/config/alpha/linux-elf.h +++ b/gcc/config/alpha/linux-elf.h @@ -41,3 +41,10 @@ Boston, MA 02111-1307, USA. */ #undef LIB_SPEC #define LIB_SPEC \ "%{pthread:-lpthread} %{shared:-lc}%{!shared:%{profile:-lc_p}%{!profile:-lc}} " + +#define ASM_FILE_END(FILE) \ + do { \ + named_section_flags (".note.GNU-stack", \ + SECTION_DEBUG \ + | (trampolines_created ? SECTION_CODE : 0)); \ + } while (0) diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index c96ac8c..f2d94c2 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -4729,6 +4729,10 @@ ix86_asm_file_end (file) output_asm_insn ("mov{l}\t{%1, %0|%0, %1}", xops); output_asm_insn ("ret", xops); } + +#ifdef SUBTARGET_FILE_END + SUBTARGET_FILE_END (file); +#endif } /* Emit code for the SET_GOT patterns. */ diff --git a/gcc/config/i386/linux.h b/gcc/config/i386/linux.h index 90dcd1d..3041368 100644 --- a/gcc/config/i386/linux.h +++ b/gcc/config/i386/linux.h @@ -219,6 +219,13 @@ Boston, MA 02111-1307, USA. */ : "=d"(BASE)) #endif +#define SUBTARGET_FILE_END(FILE) \ + do { \ + named_section_flags (".note.GNU-stack", \ + SECTION_DEBUG \ + | (trampolines_created ? SECTION_CODE : 0)); \ + } while (0) + /* Do code reading to identify a signal frame, and set the frame state data appropriately. See unwind-dw2.c for the structs. */ diff --git a/gcc/config/i386/linux64.h b/gcc/config/i386/linux64.h index 575cbee..341ef32 100644 --- a/gcc/config/i386/linux64.h +++ b/gcc/config/i386/linux64.h @@ -67,6 +67,13 @@ Boston, MA 02111-1307, USA. */ #define MULTILIB_DEFAULTS { "m64" } +#define SUBTARGET_FILE_END(FILE) \ + do { \ + named_section_flags (".note.GNU-stack", \ + SECTION_DEBUG \ + | (trampolines_created ? SECTION_CODE : 0)); \ + } while (0) + /* Do code reading to identify a signal frame, and set the frame state data appropriately. See unwind-dw2.c for the structs. Don't use this at all if inhibit_libc is used. */ diff --git a/gcc/config/m68k/linux.h b/gcc/config/m68k/linux.h index 9e81a0a..82015d3 100644 --- a/gcc/config/m68k/linux.h +++ b/gcc/config/m68k/linux.h @@ -334,3 +334,10 @@ do { \ : "d" (_beg), "d" (_len) \ : "%d0", "%d2", "%d3"); \ } + +#define ASM_FILE_END(FILE) \ + do { \ + named_section_flags (".note.GNU-stack", \ + SECTION_DEBUG \ + | (trampolines_created ? SECTION_CODE : 0)); \ + } while (0) diff --git a/gcc/config/rs6000/linux.h b/gcc/config/rs6000/linux.h index 0eaf5df..7234d13 100644 --- a/gcc/config/rs6000/linux.h +++ b/gcc/config/rs6000/linux.h @@ -86,6 +86,13 @@ /* We don't need to generate entries in .fixup. */ #undef RELOCATABLE_NEEDS_FIXUP +#define ASM_FILE_END(FILE) \ + do { \ + named_section_flags (".note.GNU-stack", \ + SECTION_DEBUG \ + | (trampolines_created ? SECTION_CODE : 0)); \ + } while (0) + /* Do code reading to identify a signal frame, and set the frame state data appropriately. See unwind-dw2.c for the structs. */ diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h index f63b7d4..f611471 100644 --- a/gcc/config/rs6000/linux64.h +++ b/gcc/config/rs6000/linux64.h @@ -503,6 +503,14 @@ while (0) #undef DRAFT_V4_STRUCT_RET #define DRAFT_V4_STRUCT_RET (!TARGET_64BIT) +#define ASM_FILE_END(FILE) \ + do { \ + if (! TARGET_64BIT) \ + named_section_flags (".note.GNU-stack", \ + SECTION_DEBUG \ + | (trampolines_created ? SECTION_CODE : 0)); \ + } while (0) + /* Do code reading to identify a signal frame, and set the frame state data appropriately. See unwind-dw2.c for the structs. */ diff --git a/gcc/config/rs6000/ppc-asm.h b/gcc/config/rs6000/ppc-asm.h index 0553283..74e1483 100644 --- a/gcc/config/rs6000/ppc-asm.h +++ b/gcc/config/rs6000/ppc-asm.h @@ -157,3 +157,8 @@ FUNC_NAME(name): GLUE(.L,name): \ .size FUNC_NAME(name),GLUE(.L,name)-FUNC_NAME(name) #endif + +#if defined __linux__ && !defined __powerpc64__ + .section .note.GNU-stack + .previous +#endif diff --git a/gcc/config/s390/linux.h b/gcc/config/s390/linux.h index cc496bd..e4b3453 100644 --- a/gcc/config/s390/linux.h +++ b/gcc/config/s390/linux.h @@ -121,6 +121,12 @@ Boston, MA 02111-1307, USA. */ { "link_arch31", LINK_ARCH31_SPEC }, \ { "link_arch64", LINK_ARCH64_SPEC }, \ +#define ASM_FILE_END(FILE) \ + do { \ + named_section_flags (".note.GNU-stack", \ + SECTION_DEBUG \ + | (trampolines_created ? SECTION_CODE : 0)); \ + } while (0) /* Do code reading to identify a signal frame, and set the frame state data appropriately. See unwind-dw2.c for the structs. */ diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h index 63ce3b9..c78f156 100644 --- a/gcc/config/sparc/linux.h +++ b/gcc/config/sparc/linux.h @@ -259,6 +259,13 @@ do { \ #undef CTORS_SECTION_ASM_OP #undef DTORS_SECTION_ASM_OP +#define ASM_FILE_END(FILE) \ + do { \ + named_section_flags (".note.GNU-stack", \ + SECTION_DEBUG \ + | (trampolines_created ? SECTION_CODE : 0)); \ + } while (0) + /* Do code reading to identify a signal frame, and set the frame state data appropriately. See unwind-dw2.c for the structs. */ diff --git a/gcc/config/sparc/linux64.h b/gcc/config/sparc/linux64.h index ecdd520..0bb1e64 100644 --- a/gcc/config/sparc/linux64.h +++ b/gcc/config/sparc/linux64.h @@ -324,6 +324,13 @@ do { \ #undef CTORS_SECTION_ASM_OP #undef DTORS_SECTION_ASM_OP +#define ASM_FILE_END(FILE) \ + do { \ + named_section_flags (".note.GNU-stack", \ + SECTION_DEBUG \ + | (trampolines_created ? SECTION_CODE : 0)); \ + } while (0) + /* Do code reading to identify a signal frame, and set the frame state data appropriately. See unwind-dw2.c for the structs. */ diff --git a/gcc/function.c b/gcc/function.c index c090d4a..9924bb5 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -129,6 +129,9 @@ int current_function_uses_only_leaf_regs; post-instantiation libcalls. */ int virtuals_instantiated; +/* Nonzero if at least one trampoline has been created. */ +int trampolines_created; + /* Assign unique numbers to labels generated for profiling, debugging, etc. */ static GTY(()) int funcdef_no; @@ -7024,6 +7027,7 @@ expand_function_end (filename, line, end_bindings) emit_block_move (blktramp, initial_trampoline, GEN_INT (TRAMPOLINE_SIZE), BLOCK_OP_NORMAL); #endif + trampolines_created = 1; INITIALIZE_TRAMPOLINE (tramp, XEXP (DECL_RTL (function), 0), context); seq = get_insns (); end_sequence (); diff --git a/gcc/function.h b/gcc/function.h index d29b40c..f9db14c 100644 --- a/gcc/function.h +++ b/gcc/function.h @@ -513,6 +513,9 @@ extern GTY(()) struct function *cfun; /* Nonzero if we've already converted virtual regs to hard regs. */ extern int virtuals_instantiated; +/* Nonzero if at least one trampoline has been created. */ +extern int trampolines_created; + /* For backward compatibility... eventually these should all go away. */ #define current_function_name (cfun->name) #define current_function_pops_args (cfun->pops_args) |