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
This commit is contained in:
Jakub Jelinek 2003-06-04 18:44:51 +02:00 committed by Jakub Jelinek
parent d2c49530bb
commit 3edc56a9e5
14 changed files with 96 additions and 0 deletions

View File

@ -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

View File

@ -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)

View File

@ -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. */

View File

@ -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. */

View File

@ -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. */

View File

@ -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)

View File

@ -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. */

View File

@ -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. */

View File

@ -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

View File

@ -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. */

View File

@ -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. */

View File

@ -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. */

View File

@ -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 ();

View File

@ -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)