OSDN Git Service

Fix support for PECOFF weak symbols
authorNick Clifton <nickc@redhat.com>
Mon, 8 Nov 2004 08:12:53 +0000 (08:12 +0000)
committerNick Clifton <nickc@redhat.com>
Mon, 8 Nov 2004 08:12:53 +0000 (08:12 +0000)
bfd/ChangeLog
bfd/coff-i386.c
include/coff/ChangeLog
include/coff/pe.h

index 849761e..dbd2d53 100644 (file)
@@ -1,3 +1,11 @@
+2004-11-08  Aaron W. LaFramboise <aaron98wiridge9@aaronwl.com>
+
+       * coff-i386.c (coff_i386_reloc): Fix weak symbols.
+       * cofflink.c (_bfd_coff_link_input_bfd): Don't process
+       C_NT_WEAK aux entries.
+       (_bfd_coff_generic_relocate_section): Handle undefined
+       aliases.
+
 2004-11-07  Andreas Schwab  <schwab@suse.de>
 
        * elf32-m68k.c (elf_m68k_adjust_dynamic_symbol): Use
index 65700b6..bdd4083 100644 (file)
@@ -4,21 +4,21 @@
    Free Software Foundation, Inc.
    Written by Cygnus Support.
 
-This file is part of BFD, the Binary File Descriptor library.
+   This file is part of BFD, the Binary File Descriptor library.
 
-This program 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 of the License, or
-(at your option) any later version.
+   This program 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 of the License, or
+   (at your option) any later version.
 
-This program 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.
+   This program 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 this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   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 02111-1307, USA.  */
 
 #include "bfd.h"
 #include "sysdep.h"
@@ -119,6 +119,8 @@ coff_i386_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd,
             here.  */
          if (howto->pc_relative && howto->pcrel_offset)
            diff = -(1 << howto->size);
+         else if (symbol->flags & BSF_WEAK)
+           diff = reloc_entry->addend - symbol->value;
          else
            diff = -reloc_entry->addend;
        }
index 290a507..d107734 100644 (file)
@@ -1,3 +1,9 @@
+2004-11-08  Aaron W. LaFramboise <aaron98wiridge9@aaronwl.com>
+
+       * pe.h (IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY): Define.
+       (IMAGE_WEAK_EXTERN_SEARCH_LIBRARY): Same.
+       (IMAGE_WEAK_EXTERN_SEARCH_ALIAS): Same.
+
 2004-08-13  Mark Kettenis  <kettenis@gnu.org>
 
        * symconst.h (langMax): Fix typo in comment.
index 363d307..46128dd 100644 (file)
@@ -1,6 +1,6 @@
 /* pe.h  -  PE COFF header information 
 
-   Copyright 2000, 2001, 2003 Free Software Foundation, Inc.
+   Copyright 2000, 2001, 2003, 2004 Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -310,4 +310,9 @@ typedef struct
 #define IMPORT_NAME_NOPREFIX   2
 #define IMPORT_NAME_UNDECORATE 3
 
+/* Weak external characteristics.  */
+#define IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY     1
+#define IMAGE_WEAK_EXTERN_SEARCH_LIBRARY       2
+#define IMAGE_WEAK_EXTERN_SEARCH_ALIAS         3
+
 #endif /* _PE_H */