From 3c6256d29e2c528880a3cf8df43adf32c7780de5 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Tue, 25 Mar 2014 16:50:10 +0000 Subject: [PATCH] This patch adds a new pseudo-op - .seh_code - to structured exception handling suite of ops. It changes the current section back to the code section of the current function. This is helpful because the code section may not be .text. * config/obj-coff-seh.c (obj_coff_seh_code): New function - switches the current segment back to the code segment recorded when seh_proc was last invoked. * config/obj-coff-seh.h (SEH_CMDS): Add seh_code. --- gas/ChangeLog | 7 +++++++ gas/config/obj-coff-seh.c | 7 +++++++ gas/config/obj-coff-seh.h | 4 +++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index d8d89f0..24a3c15 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,10 @@ +2014-03-25 Nick Clifton + + * config/obj-coff-seh.c (obj_coff_seh_code): New function - + switches the current segment back to the code segment recorded + when seh_proc was last invoked. + * config/obj-coff-seh.h (SEH_CMDS): Add seh_code. + 2014-03-25 Alan Modra * config/tc-ppc.c (ppc_is_toc_sym): Revert 2014-03-05. diff --git a/gas/config/obj-coff-seh.c b/gas/config/obj-coff-seh.c index 88c4a87..ad3fc87 100644 --- a/gas/config/obj-coff-seh.c +++ b/gas/config/obj-coff-seh.c @@ -169,6 +169,13 @@ seh_validate_seg (const char *directive) return 0; } +/* Switch back to the code section, whatever that may be. */ +static void +obj_coff_seh_code (int ignored ATTRIBUTE_UNUSED) +{ + subseg_set (seh_ctx_cur->code_seg, 0); +} + static void switch_xdata (int subseg, segT code_seg) { diff --git a/gas/config/obj-coff-seh.h b/gas/config/obj-coff-seh.h index cf4d216..cf49485 100644 --- a/gas/config/obj-coff-seh.h +++ b/gas/config/obj-coff-seh.h @@ -56,6 +56,7 @@ .seh_savereg .seh_savexmm .seh_pushframe + .seh_code */ /* architecture specific pdata/xdata handling. */ @@ -73,6 +74,7 @@ {"seh_32", obj_coff_seh_32, 1}, \ {"seh_no32", obj_coff_seh_32, 0}, \ {"seh_handler", obj_coff_seh_handler, 0}, \ + {"seh_code", obj_coff_seh_code, 0}, \ {"seh_handlerdata", obj_coff_seh_handlerdata, 0}, /* Type definitions. */ @@ -148,6 +150,7 @@ static void obj_coff_seh_32 (int); static void obj_coff_seh_proc (int); static void obj_coff_seh_handler (int); static void obj_coff_seh_handlerdata (int); +static void obj_coff_seh_code (int); #define UNDSEC bfd_und_section_ptr @@ -201,4 +204,3 @@ static void obj_coff_seh_handlerdata (int); PEX64_SCOPE_ENTRY_SIZE * (IDX)) #endif - -- 2.7.4