]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
This patch set for the generic BFD a.out backend removes a dead #define and makes...
authorGunther Nikl <gnikl@justmail.de>
Wed, 3 Jun 2020 14:24:58 +0000 (15:24 +0100)
committerNick Clifton <nickc@redhat.com>
Wed, 3 Jun 2020 14:24:58 +0000 (15:24 +0100)
* aout64.c (BMAGIC, QMAGIC): Do not define.
* aoutx.h (N_IS_BMAGIC, N_SET_QMAGIC): New defines.
(NAME (aout, some_aout_object_p)): Use N_IS_QMAGIC and N_IS_BMAGIC
to check the file format.
(adjust_z_magic): Use N_SET_QMAGIC to set file format.
* i386aout.c (NO_WRITE_HEADER_KLUDGE): Delete define.
* libaout.h (NO_WRITE_HEADER_KLUDGE): Do not define.

bfd/ChangeLog
bfd/aout64.c
bfd/aoutx.h
bfd/i386aout.c
bfd/libaout.h

index d215113495f33d77a9b1795b2fb734b1507b75ed..436eb5a2c7730673aa966f9a14d14dc0cdfea78f 100644 (file)
@@ -1,3 +1,13 @@
+2020-06-03  Gunther Nikl  <gnikl@justmail.de>
+
+       * aout64.c (BMAGIC, QMAGIC): Do not define.
+       * aoutx.h (N_IS_BMAGIC, N_SET_QMAGIC): New defines.
+       (NAME (aout, some_aout_object_p)): Use N_IS_QMAGIC and N_IS_BMAGIC
+       to check the file format.
+       (adjust_z_magic): Use N_SET_QMAGIC to set file format.
+       * i386aout.c (NO_WRITE_HEADER_KLUDGE): Delete define.
+       * libaout.h (NO_WRITE_HEADER_KLUDGE): Do not define.
+
 2020-06-03  H.J. Lu  <hongjiu.lu@intel.com>
 
        * elf-bfd.h (_bfd_elf_maybe_set_textrel): New
index 5b43a14270f655a95de4d88cf8fcd495ef6cf4f1..73e3cc7afee7db43f9d6813a4e7dbf59f6e406bc 100644 (file)
 
 #define ARCH_SIZE 64
 
-/* aoutx.h requires definitions for BMAGIC and QMAGIC.  */
-#ifndef BMAGIC
-#define BMAGIC 0
-#endif
-#ifndef QMAGIC
-#define QMAGIC 0
-#endif
-
 #include "aoutx.h"
index 08083c1555f17ff56a4c20f00d9dde43c7093c4b..8fe2a62d21c76a60e2e219473156a8977cf68d2e 100644 (file)
@@ -128,6 +128,18 @@ DESCRIPTION
 #include "aout/stab_gnu.h"
 #include "aout/ar.h"
 
+#ifdef BMAGIC
+#define N_IS_BMAGIC(x) (N_MAGIC (x) == BMAGIC)
+#else
+#define N_IS_BMAGIC(x) (0)
+#endif
+
+#ifdef QMAGIC
+#define N_SET_QMAGIC(x) N_SET_MAGIC (x, QMAGIC)
+#else
+#define N_SET_QMAGIC(x) do { /**/ } while (0)
+#endif
+
 /*
 SUBSECTION
        Relocations
@@ -492,7 +504,7 @@ NAME (aout, some_aout_object_p) (bfd *abfd,
       abfd->flags |= D_PAGED | WP_TEXT;
       adata (abfd).magic = z_magic;
     }
-  else if (N_MAGIC (execp) == QMAGIC)
+  else if (N_IS_QMAGIC (execp))
     {
       abfd->flags |= D_PAGED | WP_TEXT;
       adata (abfd).magic = z_magic;
@@ -503,8 +515,7 @@ NAME (aout, some_aout_object_p) (bfd *abfd,
       abfd->flags |= WP_TEXT;
       adata (abfd).magic = n_magic;
     }
-  else if (N_MAGIC (execp) == OMAGIC
-          || N_MAGIC (execp) == BMAGIC)
+  else if (N_MAGIC (execp) == OMAGIC || N_IS_BMAGIC (execp))
     adata (abfd).magic = o_magic;
   else
     /* Should have been checked with N_BADMAG before this routine
@@ -1026,7 +1037,7 @@ adjust_z_magic (bfd *abfd, struct internal_exec *execp)
   if (ztih && (!abdp || (abdp && !abdp->exec_header_not_counted)))
     execp->a_text += adata (abfd).exec_bytes_size;
   if (obj_aout_subformat (abfd) == q_magic_format)
-    N_SET_MAGIC (execp, QMAGIC);
+    N_SET_QMAGIC (execp);
   else
     N_SET_MAGIC (execp, ZMAGIC);
 
index 694301b5bb1513e720f2f32f2fe1acae45aa7cbf..61e0306f8d548472ced6521f28e4dae7cc3a516a 100644 (file)
@@ -38,7 +38,6 @@
    the tokens.  */
 #define MY(OP) CONCAT2 (i386_aout_,OP)
 #define TARGETNAME "a.out-i386"
-#define NO_WRITE_HEADER_KLUDGE 1
 
 #include "sysdep.h"
 #include "bfd.h"
index 61746db243a4b7f4d8de4879e07838fdf76b62b3..8e620727419dd543c73bf4054536c185a329eef5 100644 (file)
@@ -609,9 +609,6 @@ extern bfd_boolean NAME (aout, bfd_free_cached_info)
 #define        aout_32_get_section_contents    _bfd_generic_get_section_contents
 
 #define        aout_64_get_section_contents    _bfd_generic_get_section_contents
-#ifndef NO_WRITE_HEADER_KLUDGE
-#define NO_WRITE_HEADER_KLUDGE 0
-#endif
 
 #ifndef aout_32_bfd_is_local_label_name
 #define aout_32_bfd_is_local_label_name bfd_generic_is_local_label_name