Fix Opcode generation of ld a,(bc) and ld a,(de) on target z80
[binutils-gdb.git] / gas / ehopt.c
index 73dd1924bbf3615ce479866267ec50b8db6cda67..048bc57b5a09f5fbcee50e93ab90e086a9571993 100644 (file)
@@ -1,23 +1,23 @@
 /* ehopt.c--optimize gcc exception frame information.
-   Copyright 1998, 2000, 2001, 2003 Free Software Foundation, Inc.
+   Copyright 1998, 2000, 2001, 2003, 2005, 2007 Free Software Foundation, Inc.
    Written by Ian Lance Taylor <ian@cygnus.com>.
 
-This file is part of GAS, the GNU Assembler.
+   This file is part of GAS, the GNU Assembler.
 
-GAS is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
+   GAS is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
 
-GAS is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   GAS is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with GAS; see the file COPYING.  If not, write to the Free
-Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
-02110-1301, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with GAS; see the file COPYING.  If not, write to the Free
+   Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
+   02110-1301, USA.  */
 
 #include "as.h"
 #include "subsegs.h"
@@ -111,16 +111,8 @@ get_cie_info (struct cie_info *info)
 
   /* We should find the CIE at the start of the section.  */
 
-#if defined (BFD_ASSEMBLER) || defined (MANY_SEGMENTS)
   f = seg_info (now_seg)->frchainP->frch_root;
-#else
-  f = frchain_now->frch_root;
-#endif
-#ifdef BFD_ASSEMBLER
   fix = seg_info (now_seg)->frchainP->fix_root;
-#else
-  fix = *seg_fix_rootP;
-#endif
 
   /* Look through the frags of the section to find the code alignment.  */
 
@@ -283,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;