]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
elf: Define ABI_64_P in elf-bfd.h
authorH.J. Lu <hjl.tools@gmail.com>
Tue, 23 Sep 2025 00:25:49 +0000 (08:25 +0800)
committerH.J. Lu <hjl.tools@gmail.com>
Sat, 4 Oct 2025 01:09:14 +0000 (09:09 +0800)
Define ABI_64_P in elf-bfd.h to avoid duplications.

* elf-bfd.h (ABI_64_P): New.
* elfxx-mips.c (ABI_64_P): Removed.
* elfxx-sparc.c (ABI_64_P): Likewise.
* elfxx-tilegx.c (ABI_64_P): Likewise.
* elfxx-x86.h (ABI_64_P): Likewise.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
bfd/elf-bfd.h
bfd/elfxx-mips.c
bfd/elfxx-sparc.c
bfd/elfxx-tilegx.c
bfd/elfxx-x86.h

index 9ce81ebd3141ed65334b07d7182b187cf5ba0c38..5d19529d9724c359323b951bb188490be8ab3756 100644 (file)
@@ -1919,6 +1919,9 @@ struct bfd_elf_section_data
 #define get_elf_backend_data(abfd) \
    xvec_get_elf_backend_data ((abfd)->xvec)
 
+#define ABI_64_P(abfd) \
+  (get_elf_backend_data (abfd)->s->elfclass == ELFCLASS64)
+
 /* The least object attributes (within an attributes subsection) known
    for any target.  Some code assumes that the value 0 is not used and
    the field for that attribute can instead be used as a marker to
index bf3fd7df805eb3271b780f506ce4b9d2247a3e0f..181f9f5e9fcc47d2f357a27e820c40d6378d6e18 100644 (file)
@@ -816,10 +816,6 @@ static bfd *reldyn_sorting_bfd;
 #define ABI_N32_P(abfd) \
   ((elf_elfheader (abfd)->e_flags & EF_MIPS_ABI2) != 0)
 
-/* Nonzero if ABFD is using the N64 ABI.  */
-#define ABI_64_P(abfd) \
-  (get_elf_backend_data (abfd)->s->elfclass == ELFCLASS64)
-
 /* Nonzero if ABFD is using NewABI conventions.  */
 #define NEWABI_P(abfd) (ABI_N32_P (abfd) || ABI_64_P (abfd))
 
index bbaa78291323c84240c76f30f90a2d1bf14e6832..1f3b9d831d885dfc00c335b13940c6641bf2cc4f 100644 (file)
@@ -37,9 +37,6 @@
 /* In case we're on a 32-bit machine, construct a 64-bit "-1" value.  */
 #define MINUS_ONE (~ (bfd_vma) 0)
 
-#define ABI_64_P(abfd) \
-  (get_elf_backend_data (abfd)->s->elfclass == ELFCLASS64)
-
 /* The relocation "howto" table.  */
 
 /* Utility for performing the standard initial work of an instruction
index 79358e6b204973974dfff0e03d7606ff71be5bfe..577d259a3b8b08e3699cc00b5a34adcbca60b582 100644 (file)
@@ -27,9 +27,6 @@
 #include "libiberty.h"
 #include "elfxx-tilegx.h"
 
-#define ABI_64_P(abfd) \
-  (get_elf_backend_data (abfd)->s->elfclass == ELFCLASS64)
-
 #define TILEGX_ELF_WORD_BYTES(htab) \
   ((htab)->bytes_per_word)
 
index f8a24a77577171583734616759e57d8048a2a713..4cb18a914f96880d6c6423f6d4a211f854aa7cbc 100644 (file)
    header.  */
 #define PLT_SFRAME_FDE_START_OFFSET    sizeof (sframe_header)
 
-#define ABI_64_P(abfd) \
-  (get_elf_backend_data (abfd)->s->elfclass == ELFCLASS64)
-
 /* If ELIMINATE_COPY_RELOCS is non-zero, the linker will try to avoid
    copying dynamic variables from a shared lib into an app's dynbss
    section, and instead use a dynamic relocation to point into the