bfd/
[deliverable/binutils-gdb.git] / bfd / coff-arm.c
index f696bff314b8176a93a85a95f39ed1397e8ae5b1..ff4b239452c79e30860cd72dc3088b997522ad96 100644 (file)
@@ -1,6 +1,6 @@
 /* BFD back-end for ARM COFF files.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003, 2004, 2005
+   2000, 2001, 2002, 2003, 2004, 2005, 2006
    Free Software Foundation, Inc.
    Written by Cygnus Support.
 
@@ -18,7 +18,7 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02110-1301, USA.  */
+   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
 
 #include "bfd.h"
 #include "sysdep.h"
@@ -220,7 +220,7 @@ static reloc_howto_type aoutarm_std_reloc_howto[] =
           complain_overflow_dont,
           aoutarm_fix_pcrel_26_done,
           "ARM_26D",
-          FALSE,
+          TRUE,        /* partial_inplace.  */
           0x00ffffff,
           0x0,
           PCRELOFFSET),
@@ -233,7 +233,7 @@ static reloc_howto_type aoutarm_std_reloc_howto[] =
           complain_overflow_bitfield,
           coff_arm_reloc,
           "ARM_32",
-          FALSE,
+          TRUE,        /* partial_inplace.  */
           0xffffffff,
           0xffffffff,
           PCRELOFFSET),
@@ -246,7 +246,7 @@ static reloc_howto_type aoutarm_std_reloc_howto[] =
           complain_overflow_bitfield,
           coff_arm_reloc,
           "ARM_RVA32",
-          FALSE,
+          TRUE,        /* partial_inplace.  */
           0xffffffff,
           0xffffffff,
           PCRELOFFSET),
@@ -294,7 +294,7 @@ static reloc_howto_type aoutarm_std_reloc_howto[] =
           complain_overflow_bitfield,
           coff_arm_reloc,
           "ARM_SECTION",
-          FALSE,
+          TRUE,        /* partial_inplace.  */
           0x0000ffff,
           0x0000ffff,
           PCRELOFFSET),
@@ -307,7 +307,7 @@ static reloc_howto_type aoutarm_std_reloc_howto[] =
           complain_overflow_bitfield,
           coff_arm_reloc,
           "ARM_SECREL",
-          FALSE,
+          TRUE,        /* partial_inplace.  */
           0xffffffff,
           0xffffffff,
           PCRELOFFSET),
@@ -879,8 +879,10 @@ coff_arm_link_hash_table_create (bfd * abfd)
   if (ret == NULL)
     return NULL;
 
-  if (! _bfd_coff_link_hash_table_init
-      (& ret->root, abfd, _bfd_coff_link_hash_newfunc))
+  if (!_bfd_coff_link_hash_table_init (&ret->root,
+                                      abfd,
+                                      _bfd_coff_link_hash_newfunc,
+                                      sizeof (struct coff_link_hash_entry)))
     {
       free (ret);
       return NULL;
@@ -1207,12 +1209,14 @@ coff_arm_relocate_section (bfd *output_bfd,
                     generation of bl's instruction offset.  */
           addend -= 8;
 #endif
-          howto = &fake_arm26_reloc;
+          howto = & fake_arm26_reloc;
         }
 
 #ifdef ARM_WINCE
       /* MS ARM-CE makes the reloc relative to the opcode's pc, not
         the next opcode's pc, so is off by one.  */
+      if (howto->pc_relative && !info->relocatable)
+       addend -= 8;
 #endif
 
       /* If we are doing a relocatable link, then we can just ignore
@@ -1936,12 +1940,11 @@ bfd_arm_get_bfd_for_interworking (bfd *                  abfd,
 
   if (sec == NULL)
     {
-      flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_CODE | SEC_READONLY;
-
-      sec = bfd_make_section (abfd, ARM2THUMB_GLUE_SECTION_NAME);
-
+      flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY
+              | SEC_CODE | SEC_READONLY);
+      sec = bfd_make_section_with_flags (abfd, ARM2THUMB_GLUE_SECTION_NAME,
+                                        flags);
       if (sec == NULL
-         || ! bfd_set_section_flags (abfd, sec, flags)
          || ! bfd_set_section_alignment (abfd, sec, 2))
        return FALSE;
     }
@@ -1950,12 +1953,12 @@ bfd_arm_get_bfd_for_interworking (bfd *                  abfd,
 
   if (sec == NULL)
     {
-      flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_CODE | SEC_READONLY;
-
-      sec = bfd_make_section (abfd, THUMB2ARM_GLUE_SECTION_NAME);
+      flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY
+              | SEC_CODE | SEC_READONLY);
+      sec = bfd_make_section_with_flags (abfd, THUMB2ARM_GLUE_SECTION_NAME,
+                                        flags);
 
       if (sec == NULL
-         || ! bfd_set_section_flags (abfd, sec, flags)
          || ! bfd_set_section_alignment (abfd, sec, 2))
        return FALSE;
     }
This page took 0.032081 seconds and 4 git commands to generate.