about summary refs log tree commit diff
path: root/arch/aarch64/reloc.h
diff options
context:
space:
mode:
authorSzabolcs Nagy <nsz@port70.net>2015-03-10 21:18:41 +0000
committerRich Felker <dalias@aerifal.cx>2015-03-11 20:12:35 -0400
commit01ef3dd9c5fa7a56aa370f244dd08e05c73010f5 (patch)
tree8fe90d994a43124ff309d3af4c185e28b2b1d6ff /arch/aarch64/reloc.h
parentf4e4632abfa8297db1485e132bb15b9ef6c32a1b (diff)
downloadmusl-01ef3dd9c5fa7a56aa370f244dd08e05c73010f5.tar.gz
musl-01ef3dd9c5fa7a56aa370f244dd08e05c73010f5.tar.xz
musl-01ef3dd9c5fa7a56aa370f244dd08e05c73010f5.zip
add aarch64 port
This adds complete aarch64 target support including bigendian subarch.

Some of the long double math functions are known to be broken otherwise
interfaces should be fully functional, but at this point consider this
port experimental.

Initial work on this port was done by Sireesh Tripurari and Kevin Bortis.
Diffstat (limited to 'arch/aarch64/reloc.h')
-rw-r--r--arch/aarch64/reloc.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/arch/aarch64/reloc.h b/arch/aarch64/reloc.h
new file mode 100644
index 00000000..e95ae9a8
--- /dev/null
+++ b/arch/aarch64/reloc.h
@@ -0,0 +1,40 @@
+#include <string.h>
+#include <elf.h>
+#include <endian.h>
+
+#if __BYTE_ORDER == __BIG_ENDIAN
+#define ENDIAN_SUFFIX "_be"
+#else
+#define ENDIAN_SUFFIX ""
+#endif
+
+#define LDSO_ARCH "aarch64" ENDIAN_SUFFIX
+
+#define NO_LEGACY_INITFINI
+
+#define TPOFF_K 16
+
+static int remap_rel(int type)
+{
+	switch(type) {
+	case R_AARCH64_ABS64:
+		return REL_SYMBOLIC;
+	case R_AARCH64_GLOB_DAT:
+		return REL_GOT;
+	case R_AARCH64_JUMP_SLOT:
+		return REL_PLT;
+	case R_AARCH64_RELATIVE:
+		return REL_RELATIVE;
+	case R_AARCH64_COPY:
+		return REL_COPY;
+	case R_AARCH64_TLS_DTPMOD64:
+		return REL_DTPMOD;
+	case R_AARCH64_TLS_DTPREL64:
+		return REL_DTPOFF;
+	case R_AARCH64_TLS_TPREL64:
+		return REL_TPOFF;
+	case R_AARCH64_TLSDESC:
+		return REL_TLSDESC;
+	}
+	return 0;
+}