summaryrefslogtreecommitdiff
path: root/backends/aarch64_init.c
diff options
context:
space:
mode:
authorPetr Machata <pmachata@redhat.com>2013-11-26 03:10:31 +0100
committerPetr Machata <pmachata@redhat.com>2013-11-26 03:10:31 +0100
commit98c8a7395b4e5e7bed233397148b15c1f8c66490 (patch)
treee9fe459b4320c3045cc6bf7fc3e97baa85f5f5c9 /backends/aarch64_init.c
parenta47a096e2b8105326c5c58d1f50afcaefff968a0 (diff)
downloadelfutils-98c8a7395b4e5e7bed233397148b15c1f8c66490.tar.gz
Support AArch64 architecture
Signed-off-by: Petr Machata <pmachata@redhat.com>
Diffstat (limited to 'backends/aarch64_init.c')
-rw-r--r--backends/aarch64_init.c61
1 files changed, 61 insertions, 0 deletions
diff --git a/backends/aarch64_init.c b/backends/aarch64_init.c
new file mode 100644
index 00000000..749af2aa
--- /dev/null
+++ b/backends/aarch64_init.c
@@ -0,0 +1,61 @@
+/* Initialization of AArch64 specific backend library.
+ Copyright (C) 2013 Red Hat, Inc.
+ This file is part of elfutils.
+
+ This file is free software; you can redistribute it and/or modify
+ it under the terms of either
+
+ * the GNU Lesser General Public License as published by the Free
+ Software Foundation; either version 3 of the License, or (at
+ your option) any later version
+
+ or
+
+ * the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at
+ your option) any later version
+
+ or both in parallel, as here.
+
+ elfutils is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received copies of the GNU General Public License and
+ the GNU Lesser General Public License along with this program. If
+ not, see <http://www.gnu.org/licenses/>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#define BACKEND aarch64_
+#define RELOC_PREFIX R_AARCH64_
+#include "libebl_CPU.h"
+
+/* This defines the common reloc hooks based on aarch64_reloc.def. */
+#include "common-reloc.c"
+
+
+const char *
+aarch64_init (elf, machine, eh, ehlen)
+ Elf *elf __attribute__ ((unused));
+ GElf_Half machine __attribute__ ((unused));
+ Ebl *eh;
+ size_t ehlen;
+{
+ /* Check whether the Elf_BH object has a sufficent size. */
+ if (ehlen < sizeof (Ebl))
+ return NULL;
+
+ /* We handle it. */
+ eh->name = "AARCH64";
+ aarch64_init_reloc (eh);
+ HOOK (eh, register_info);
+ HOOK (eh, core_note);
+ HOOK (eh, reloc_simple_type);
+ HOOK (eh, return_value_location);
+
+ return MODVERSION;
+}