]> oss.titaniummirror.com Git - msp430-binutils.git/blobdiff - bfd/reloc16.c
Merge commit 'upstream/2.20'
[msp430-binutils.git] / bfd / reloc16.c
index 4e3107fb937d434cded6aec6c5e1c4a3bedc3b41..768b288d824fd489e8e58a39c7a2673a3b11941e 100644 (file)
@@ -1,6 +1,6 @@
 /* 8 and 16 bit COFF relocation functions, for BFD.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 2000, 2001,
 /* 8 and 16 bit COFF relocation functions, for BFD.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 2000, 2001,
-   2002, 2003, 2004, 2007 Free Software Foundation, Inc.
+   2002, 2003, 2004, 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
    Written by Cygnus Support.
 
    This file is part of BFD, the Binary File Descriptor library.
    Written by Cygnus Support.
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -76,6 +76,10 @@ bfd_coff_reloc16_get_value (reloc, link_info, input_section)
       else if (h != (struct bfd_link_hash_entry *) NULL
               && h->type == bfd_link_hash_common)
        value = h->u.c.size;
       else if (h != (struct bfd_link_hash_entry *) NULL
               && h->type == bfd_link_hash_common)
        value = h->u.c.size;
+      else if (h != (struct bfd_link_hash_entry *) NULL
+              && h->type == bfd_link_hash_undefweak)
+       /* This is a GNU extension.  */
+       value = 0;
       else
        {
          if (!((*link_info->callbacks->undefined_symbol)
       else
        {
          if (!((*link_info->callbacks->undefined_symbol)
@@ -153,6 +157,10 @@ bfd_coff_reloc16_relax_section (abfd, input_section, link_info, again)
   arelent **reloc_vector = NULL;
   long reloc_count;
 
   arelent **reloc_vector = NULL;
   long reloc_count;
 
+  if (link_info->relocatable)
+    (*link_info->callbacks->einfo)
+      (_("%P%F: --relax and -r may not be used together\n"));
+
   /* We only do global relaxation once.  It is not safe to do it multiple
      times (see discussion of the "shrinks" array below).  */
   *again = FALSE;
   /* We only do global relaxation once.  It is not safe to do it multiple
      times (see discussion of the "shrinks" array below).  */
   *again = FALSE;