aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2003-02-10 11:21:19 +0000
committerNick Clifton <nickc@redhat.com>2003-02-10 11:21:19 +0000
commitc178919ba9648c8e10de663c9f72adc8a8188376 (patch)
tree6f75e47bcd64cd7e6e820d5381abae49ad2b768d /bfd
parentfde78edd7af5c957f88e3a8c4266c663a8bd2df0 (diff)
downloadgdb-c178919ba9648c8e10de663c9f72adc8a8188376.zip
gdb-c178919ba9648c8e10de663c9f72adc8a8188376.tar.gz
gdb-c178919ba9648c8e10de663c9f72adc8a8188376.tar.bz2
Add function to set machine number based on flags in header.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog2
-rw-r--r--bfd/elf32-arm.h20
2 files changed, 20 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 2e1138e..9841d59 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -8,6 +8,8 @@
messages and add test for Maverick floating point support.
(elf32_arm_print_private_bfd_data): Handle
EF_ARM_MAVERICK_FLOAT flag.
+ (elf32_arm_object_p): New function.
+ (elf_backend_object_p): Define.
2003-02-10 Alan Modra <amodra@bigpond.net.au>
diff --git a/bfd/elf32-arm.h b/bfd/elf32-arm.h
index 3c56eb8..effe7e6 100644
--- a/bfd/elf32-arm.h
+++ b/bfd/elf32-arm.h
@@ -1,5 +1,5 @@
/* 32-bit ELF support for ARM
- Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -86,6 +86,8 @@ static void arm_add_to_rel
#endif
static enum elf_reloc_type_class elf32_arm_reloc_type_class
PARAMS ((const Elf_Internal_Rela *));
+static bfd_boolean elf32_arm_object_p
+ PARAMS ((bfd *));
#ifndef ELFARM_NABI_C_INCLUDED
static void record_arm_to_thumb_glue
@@ -2108,6 +2110,20 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section,
return TRUE;
}
+/* Set the right machine number. */
+
+static bfd_boolean
+elf32_arm_object_p (abfd)
+ bfd *abfd;
+{
+ /* XXX - we ought to examine a .note section here. */
+
+ if (elf_elfheader (abfd)->e_flags & EF_ARM_MAVERICK_FLOAT)
+ bfd_default_set_arch_mach (abfd, bfd_arch_arm, bfd_mach_arm_ep9312);
+
+ return TRUE;
+}
+
/* Function to keep ARM specific flags in the ELF header. */
static bfd_boolean
elf32_arm_set_private_flags (abfd, flags)
@@ -3641,7 +3657,6 @@ elf32_arm_reloc_type_class (rela)
}
}
-
#define ELF_ARCH bfd_arch_arm
#define ELF_MACHINE_CODE EM_ARM
#define ELF_MAXPAGESIZE 0x8000
@@ -3666,6 +3681,7 @@ elf32_arm_reloc_type_class (rela)
#define elf_backend_size_dynamic_sections elf32_arm_size_dynamic_sections
#define elf_backend_post_process_headers elf32_arm_post_process_headers
#define elf_backend_reloc_type_class elf32_arm_reloc_type_class
+#define elf_backend_object_p elf32_arm_object_p
#define elf_backend_can_gc_sections 1
#define elf_backend_plt_readonly 1