diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2025-09-23 08:25:49 +0800 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2025-10-04 09:09:14 +0800 |
commit | 025c45fdaca4e4bbfe16cb7931f77d6f68c5356c (patch) | |
tree | 61a13ed1771da1a9b852948deb8740d7da2d6b77 | |
parent | c572eb343a2696eec155c0b23519b22b7af8cfb2 (diff) | |
download | binutils-025c45fdaca4e4bbfe16cb7931f77d6f68c5356c.zip binutils-025c45fdaca4e4bbfe16cb7931f77d6f68c5356c.tar.gz binutils-025c45fdaca4e4bbfe16cb7931f77d6f68c5356c.tar.bz2 |
elf: Define ABI_64_P in elf-bfd.h
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>
-rw-r--r-- | bfd/elf-bfd.h | 3 | ||||
-rw-r--r-- | bfd/elfxx-mips.c | 4 | ||||
-rw-r--r-- | bfd/elfxx-sparc.c | 3 | ||||
-rw-r--r-- | bfd/elfxx-tilegx.c | 3 | ||||
-rw-r--r-- | bfd/elfxx-x86.h | 3 |
5 files changed, 3 insertions, 13 deletions
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index 9ce81eb..5d19529 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -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 diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c index bf3fd7d..181f9f5 100644 --- a/bfd/elfxx-mips.c +++ b/bfd/elfxx-mips.c @@ -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)) diff --git a/bfd/elfxx-sparc.c b/bfd/elfxx-sparc.c index bbaa782..1f3b9d8 100644 --- a/bfd/elfxx-sparc.c +++ b/bfd/elfxx-sparc.c @@ -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 diff --git a/bfd/elfxx-tilegx.c b/bfd/elfxx-tilegx.c index 79358e6..577d259 100644 --- a/bfd/elfxx-tilegx.c +++ b/bfd/elfxx-tilegx.c @@ -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) diff --git a/bfd/elfxx-x86.h b/bfd/elfxx-x86.h index f8a24a7..4cb18a9 100644 --- a/bfd/elfxx-x86.h +++ b/bfd/elfxx-x86.h @@ -102,9 +102,6 @@ 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 |