This is the mail archive of the 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]: Allow target control of eh optimization

Nick Clifton wrote:
  I am applying the attached patch to implement a new target macro -
  md_allow_eh_opt which can be used to disable the call frame
  optimization code if the target so desires.  This is needed by the
  MN10300 port because its linker relaxation changes the size of
  function prologues which means that some of the optimizations in
  ehopt.c cannot be applied.

The Xtensa port has the same issue, at least in theory. We don't attempt to describe the CFA at each point in the function prologue, so it may not matter in practice. I'm committing the following patch just to be on the safe side.

        * config/tc-xtensa.h (md_allow_eh_opt): Define.

        * gas/elf/elf.exp: Disable ehopt test for Xtensa.

Index: config/tc-xtensa.h
RCS file: /cvs/src/src/gas/config/tc-xtensa.h,v
retrieving revision 1.27
diff -u -r1.27 tc-xtensa.h
--- config/tc-xtensa.h	2 Nov 2007 00:45:34 -0000	1.27
+++ config/tc-xtensa.h	30 Nov 2007 23:45:50 -0000
@@ -374,6 +374,10 @@
 #define md_relax_frag(segment, fragP, stretch) \
   xtensa_relax_frag (fragP, stretch, &stretched)
+/* Only allow call frame debug info optimization when linker relaxation is
+   not enabled as otherwise we could generate the DWARF directives without
+   the relocs necessary to patch them up.  */
+#define md_allow_eh_opt (linkrelax == 0)
 #define LOCAL_LABELS_FB 1
Index: testsuite/gas/elf/elf.exp
RCS file: /cvs/src/src/gas/testsuite/gas/elf/elf.exp,v
retrieving revision 1.44
diff -u -r1.44 elf.exp
--- testsuite/gas/elf/elf.exp	7 Nov 2007 14:32:54 -0000	1.44
+++ testsuite/gas/elf/elf.exp	30 Nov 2007 23:45:50 -0000
@@ -74,9 +74,12 @@
-    # The MN10300 port disables the assembler's call frame optimization
-    # because it interfers with link time relaxation of function prologues.
-    if {![istarget "mn10300-*-*"] && ![istarget "am3*-*-*"]} then {    
+    # The MN10300 and Xtensa ports disable the assembler's call frame
+    # optimization because it interfers with link-time relaxation of
+    # function prologues.
+    if {![istarget "mn10300-*-*"]
+	&& ![istarget "xtensa*-*-*"]
+	&& ![istarget "am3*-*-*"]} then {    
       run_dump_test "ehopt0"
     run_dump_test "group0a" 

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