]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - bfd/coff-x86_64.c
ARC e_flags vs. objcopy
[thirdparty/binutils-gdb.git] / bfd / coff-x86_64.c
index f5bd5a27c40739826b325d1e577bb6ecd63957d3..0f9c3c2580e751d6e66d1bc13838f00c75284f01 100644 (file)
@@ -1,5 +1,5 @@
 /* BFD back-end for AMD 64 COFF files.
-   Copyright (C) 2006-2023 Free Software Foundation, Inc.
+   Copyright (C) 2006-2024 Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
 
    Written by Kai Tietz, OneVision Software GmbH&CoKg.  */
 
-/* Note we have to make sure not to include headers twice.
-   Not all headers are wrapped in #ifdef guards, so we define
-   PEI_HEADERS to prevent double including here.  */
-#ifndef PEI_HEADERS
 #include "sysdep.h"
 #include "bfd.h"
 #include "libbfd.h"
@@ -31,7 +27,6 @@
 #include "coff/internal.h"
 #include "libcoff.h"
 #include "libiberty.h"
-#endif
 
 #define BADMAG(x) AMD64BADMAG(x)
 
@@ -547,7 +542,8 @@ static reloc_howto_type howto_table[] =
       cache_ptr->addend = - coffsym->native->u.syment.n_value; \
     else if (ptr && bfd_asymbol_bfd (ptr) == abfd              \
             && ptr->section != NULL)                           \
-      cache_ptr->addend = - (ptr->section->vma + ptr->value);  \
+      cache_ptr->addend = - (ptr->section->vma                 \
+                            + COFF_PE_ADDEND_BIAS (ptr));      \
     else                                                       \
       cache_ptr->addend = 0;                                   \
     if (ptr && reloc.r_type < NUM_HOWTOS                       \