Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/gnu/dist/toolchain/bfd Implement elf32_arm_object_p().
details: https://anonhg.NetBSD.org/src/rev/17ade7a00ab4
branches: trunk
changeset: 524966:17ade7a00ab4
user: thorpej <thorpej%NetBSD.org@localhost>
date: Wed Apr 03 02:59:13 2002 +0000
description:
Implement elf32_arm_object_p().
diffstat:
gnu/dist/toolchain/bfd/elfarm-nabi.c | 28 ++++++++++++++++++++++++++++
1 files changed, 28 insertions(+), 0 deletions(-)
diffs (45 lines):
diff -r 5f64c97e0739 -r 17ade7a00ab4 gnu/dist/toolchain/bfd/elfarm-nabi.c
--- a/gnu/dist/toolchain/bfd/elfarm-nabi.c Wed Apr 03 02:31:32 2002 +0000
+++ b/gnu/dist/toolchain/bfd/elfarm-nabi.c Wed Apr 03 02:59:13 2002 +0000
@@ -41,6 +41,8 @@
static reloc_howto_type * elf32_arm_reloc_type_lookup
PARAMS ((bfd * abfd, bfd_reloc_code_real_type code));
+static boolean elf32_arm_object_p PARAMS ((bfd *));
+
/* Note: code such as elf32_arm_reloc_type_lookup expect to use e.g.
R_ARM_PC24 as an index into this, and find the R_ARM_PC24 HOWTO
in that slot. */
@@ -672,6 +674,32 @@
}
}
+/* Return nonzero if ABFD represents an ARM ELF32 file. */
+
+static boolean
+elf32_arm_object_p (abfd)
+ bfd *abfd;
+{
+ Elf_Internal_Ehdr * i_ehdrp;
+
+ i_ehdrp = elf_elfheader (abfd);
+ if (strcmp (bfd_get_target (abfd), "elf32-littlearm-nbsd") == 0
+ || strcmp (bfd_get_target (abfd), "elf32-bigarm-nbsd") == 0)
+ {
+ if (i_ehdrp->e_ident[EI_OSABI] != ARM_ELF_OS_ABI_VERSION_NBSD)
+ return false;
+ }
+ else
+ {
+ if (i_ehdrp->e_ident[EI_OSABI] != ARM_ELF_OS_ABI_VERSION)
+ return false;
+ }
+
+ return true;
+}
+
+#define elf_backend_object_p elf32_arm_object_p
+
#define TARGET_LITTLE_SYM bfd_elf32_littlearm_vec
#define TARGET_LITTLE_NAME "elf32-littlearm"
#define TARGET_BIG_SYM bfd_elf32_bigarm_vec
Home |
Main Index |
Thread Index |
Old Index