nios2.c (nios2_asm_file_end): Implement TARGET_ASM_FILE_END hook for adding .note.GNU-stack section when needed.

2015-01-20  Chung-Lin Tang  <cltang@codesourcery.com>

	gcc/
	* config/nios2/nios2.c (nios2_asm_file_end): Implement
	TARGET_ASM_FILE_END hook for adding .note.GNU-stack section when
	needed.
	(TARGET_ASM_FILE_END): Define.

	libgcc/
	* config/nios2/linux-unwind.h (nios2_fallback_frame_state):
	Update rt_sigframe format and address for current Nios II
	Linux conventions.

From-SVN: r219898
This commit is contained in:
Chung-Lin Tang 2015-01-20 14:49:51 +00:00 committed by Chung-Lin Tang
parent 3b6444f0aa
commit a9ce4e4a70
4 changed files with 29 additions and 2 deletions

View File

@ -1,3 +1,10 @@
2015-01-20 Chung-Lin Tang <cltang@codesourcery.com>
* config/nios2/nios2.c (nios2_asm_file_end): Implement
TARGET_ASM_FILE_END hook for adding .note.GNU-stack section when
needed.
(TARGET_ASM_FILE_END): Define.
2015-01-20 Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org>
* config/arm/arm-protos.h (enum arm_sched_autopref): New constants.

View File

@ -2223,6 +2223,18 @@ nios2_output_dwarf_dtprel (FILE *file, int size, rtx x)
fprintf (file, ")");
}
/* Implemet TARGET_ASM_FILE_END. */
static void
nios2_asm_file_end (void)
{
/* The Nios II Linux stack is mapped non-executable by default, so add a
.note.GNU-stack section for switching to executable stacks only when
trampolines are generated. */
if (TARGET_LINUX_ABI && trampolines_created)
file_end_indicate_exec_stack ();
}
/* Implement TARGET_ASM_FUNCTION_PROLOGUE. */
static void
nios2_asm_function_prologue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
@ -3401,6 +3413,9 @@ nios2_merge_decl_attributes (tree olddecl, tree newdecl)
#undef TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA
#define TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA nios2_output_addr_const_extra
#undef TARGET_ASM_FILE_END
#define TARGET_ASM_FILE_END nios2_asm_file_end
#undef TARGET_OPTION_OVERRIDE
#define TARGET_OPTION_OVERRIDE nios2_option_override

View File

@ -1,3 +1,9 @@
2015-01-20 Chung-Lin Tang <cltang@codesourcery.com>
* config/nios2/linux-unwind.h (nios2_fallback_frame_state):
Update rt_sigframe format and address for current Nios II
Linux conventions.
2015-01-09 Andreas Tobler <andreast@gcc.gnu.org>
* config.host (arm*-*-freebsd*): Add new configuration for

View File

@ -67,10 +67,9 @@ nios2_fallback_frame_state (struct _Unwind_Context *context,
if (pc[0] == (0x00800004 | (__NR_rt_sigreturn << 6)))
{
struct rt_sigframe {
char retcode[12];
siginfo_t info;
struct nios2_ucontext uc;
} *rt_ = context->ra;
} *rt_ = context->cfa;
struct nios2_mcontext *regs = &rt_->uc.uc_mcontext;
int i;