This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix EH frame problem on Solaris


> Ok.

Thanks.  However I tested this on Solaris 9 and for x86 this means that the 
64-bit mode was not exercised...  The following change is needed for it.

Tested on x86-linux and x86-solaris2.10, OK for mainline and 2.19 branch?


2008-10-09  Eric Botcazou  <ebotcazou@adacore.com>

gas/
	* dw2gencfi.c (cfi_finish): Deal with md_fix_up_eh_frame.
	* config/tc-i386.h (md_fix_up_eh_frame): Define on Solaris.
	(i386_solaris_fix_up_eh_frame): Declare.
	* config/tc-i386.c (i386_solaris_fix_up_eh_frame): New function.


-- 
Eric Botcazou
Index: dw2gencfi.c
===================================================================
RCS file: /cvs/src/src/gas/dw2gencfi.c,v
retrieving revision 1.36.2.2
diff -u -p -r1.36.2.2 dw2gencfi.c
--- dw2gencfi.c	29 Sep 2008 10:45:29 -0000	1.36.2.2
+++ dw2gencfi.c	9 Oct 2008 14:33:01 -0000
@@ -1496,6 +1496,10 @@ cfi_finish (void)
   subseg_set (cfi_seg, 0);
   record_alignment (cfi_seg, EH_FRAME_ALIGNMENT);
 
+#ifdef md_fix_up_eh_frame
+  md_fix_up_eh_frame (cfi_seg);
+#endif
+
   /* Make sure check_eh_frame doesn't do anything with our output.  */
   save_flag_traditional_format = flag_traditional_format;
   flag_traditional_format = 1;
Index: config/tc-i386.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-i386.c,v
retrieving revision 1.352
diff -u -p -r1.352 tc-i386.c
--- config/tc-i386.c	3 Sep 2008 15:44:33 -0000	1.352
+++ config/tc-i386.c	9 Oct 2008 14:33:02 -0000
@@ -10105,6 +10105,15 @@ i386_elf_section_type (const char *str, 
   return -1;
 }
 
+#ifdef TE_SOLARIS
+void
+i386_solaris_fix_up_eh_frame (segT sec)
+{
+  if (flag_code == CODE_64BIT)
+    elf_section_type (sec) = SHT_X86_64_UNWIND;
+}
+#endif
+
 #ifdef TE_PE
 void
 tc_pe_dwarf2_emit_offset (symbolS *symbol, unsigned int size)
Index: config/tc-i386.h
===================================================================
RCS file: /cvs/src/src/gas/config/tc-i386.h,v
retrieving revision 1.97
diff -u -p -r1.97 tc-i386.h
--- config/tc-i386.h	13 Feb 2008 10:14:38 -0000	1.97
+++ config/tc-i386.h	9 Oct 2008 14:33:02 -0000
@@ -212,6 +212,11 @@ extern void tc_x86_frame_initial_instruc
 #define md_elf_section_type(str,len) i386_elf_section_type (str, len)
 extern int i386_elf_section_type (const char *, size_t);
 
+#ifdef TE_SOLARIS
+#define md_fix_up_eh_frame(sec) i386_solaris_fix_up_eh_frame (sec)
+extern void i386_solaris_fix_up_eh_frame (segT);
+#endif
+
 /* Support for SHF_X86_64_LARGE */
 extern int x86_64_section_word (char *, size_t);
 extern int x86_64_section_letter (int, char **);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]