]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* ehopt.c (check_eh_frame): If md_allow_eh_opt is defined, invoke it to see if the...
authorNick Clifton <nickc@redhat.com>
Tue, 6 Nov 2007 17:15:10 +0000 (17:15 +0000)
committerNick Clifton <nickc@redhat.com>
Tue, 6 Nov 2007 17:15:10 +0000 (17:15 +0000)
* config/tc-mn10300.h (md_allow_eh_opt): Define.  Only allow call frame optimization if linker relaxation is not enabled.
* gas/elf/elf.exp: Disable ehopt test for mn10300.

gas/ChangeLog
gas/config/tc-mn10300.h
gas/doc/internals.texi
gas/ehopt.c
gas/testsuite/ChangeLog
gas/testsuite/gas/elf/elf.exp

index 637be807f107977be1a211b37ec9b6b25ee5a34a..e92fccbca968cf4c53a461c77c07396b310fcef9 100644 (file)
@@ -1,3 +1,10 @@
+2007-11-06  Nick Clifton  <nickc@redhat.com>
+
+       * ehopt.c (check_eh_frame): If md_allow_eh_opt is defined, invoke
+       it to see if the optimizations should be applied.
+       * config/tc-mn10300.h (md_allow_eh_opt): Define.  Only allow call
+       frame optimization if linker relaxation is not enabled.
+
 2007-11-05  Danny Smith  <dannysmith@users.sourceforge.net>
 
        * read.c (ALIGN_LIMIT): Rename to ...
index 8a2e457eb5a3c71457afb2256fcf4f74a992e491..ca51eda7a34f375749e8755bdfddd502fafdde4f 100644 (file)
@@ -120,3 +120,8 @@ extern bfd_boolean mn10300_allow_local_subtract (expressionS *, expressionS *, s
 
 #define HANDLE_ALIGN(frag) mn10300_handle_align (frag)
 extern void mn10300_handle_align (fragS *);
+
+/* 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)
index 62f16f7f3d4d9978ddd0f3b08b1cdacf0a2629de..78b767e5f9bd6d94a146a63329faff84ed7dd8a2 100644 (file)
@@ -1547,6 +1547,11 @@ evaluated.  Targets which implement link time relaxation which may change the
 position of the two symbols relative to each other should ensure that this
 macro returns zero in situations where this can occur.
 
+@item md_allow_eh_opt
+If defined, GAS will check this macro before performing any optimizations on
+the DWARF call frame debug information that is emitted.  Targets which
+implement link time relaxation may need to define this macro and set it to zero
+if it is possible to change the size of a function's prologue.
 @end table
 
 @node Object format backend
index 2b0609be005df59ab1423ea342f56bb3c966e9d4..048bc57b5a09f5fbcee50e93ab90e086a9571993 100644 (file)
@@ -275,6 +275,11 @@ check_eh_frame (expressionS *exp, unsigned int *pnbytes)
   if (flag_traditional_format)
     return 0;
 
+#ifdef md_allow_eh_opt
+  if (! md_allow_eh_opt)
+    return 0;
+#endif
+
   /* Select the proper section data.  */
   if (strcmp (segment_name (now_seg), ".eh_frame") == 0)
     d = &eh_frame_data;
index bbce8cabf47a267e8739f9c9b8888166e9dd3918..fdb57bc0eef0b7ca9093ce4666a0ec1eda04ebdd 100644 (file)
@@ -1,3 +1,7 @@
+2007-11-06  Nick Clifton  <nickc@redhat.com>
+
+       * gas/elf/elf.exp: Disable ehopt test for mn10300.
+
 2007-11-01  H.J. Lu  <hongjiu.lu@intel.com>
 
        * gas/i386/i386.d: New.
index c5e2921623f6df1675bdd0b7e06db04fa1246770..28f8e51a400700e787a15f66b8cfcb7958d885d2 100644 (file)
@@ -73,7 +73,12 @@ if { ([istarget "*-*-*elf*"]
            set target_machine -armelf
        }
     }
-    run_dump_test "ehopt0"
+
+    # 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 {    
+      run_dump_test "ehopt0"
+    }
     run_dump_test "group0a" 
     run_dump_test "group0b" 
     run_dump_test "group1a"