summaryrefslogtreecommitdiffstats
path: root/libc-top-half/musl/arch/microblaze/reloc.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 13:54:38 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 13:54:38 +0000
commit8c1ab65c0f548d20b7f177bdb736daaf603340e1 (patch)
treedf55b7e75bf43f2bf500845b105afe3ac3a5157e /libc-top-half/musl/arch/microblaze/reloc.h
parentInitial commit. (diff)
downloadwasi-libc-upstream/0.0_git20221206.8b7148f.tar.xz
wasi-libc-upstream/0.0_git20221206.8b7148f.zip
Adding upstream version 0.0~git20221206.8b7148f.upstream/0.0_git20221206.8b7148f
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'libc-top-half/musl/arch/microblaze/reloc.h')
-rw-r--r--libc-top-half/musl/arch/microblaze/reloc.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/libc-top-half/musl/arch/microblaze/reloc.h b/libc-top-half/musl/arch/microblaze/reloc.h
new file mode 100644
index 0000000..6302c6e
--- /dev/null
+++ b/libc-top-half/musl/arch/microblaze/reloc.h
@@ -0,0 +1,27 @@
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+#define ENDIAN_SUFFIX "el"
+#else
+#define ENDIAN_SUFFIX ""
+#endif
+
+#define LDSO_ARCH "microblaze" ENDIAN_SUFFIX
+
+#define TPOFF_K 0
+
+#define REL_SYMBOLIC R_MICROBLAZE_32
+#define REL_GOT R_MICROBLAZE_GLOB_DAT
+#define REL_PLT R_MICROBLAZE_JUMP_SLOT
+#define REL_RELATIVE R_MICROBLAZE_REL
+#define REL_COPY R_MICROBLAZE_COPY
+#define REL_DTPMOD R_MICROBLAZE_TLSDTPMOD32
+#define REL_DTPOFF R_MICROBLAZE_TLSDTPREL32
+
+#define CRTJMP(pc,sp) __asm__ __volatile__( \
+ "addik r1,%1,0 ; bra %0" : : "r"(pc), "r"(sp) : "memory" )
+
+#define GETFUNCSYM(fp, sym, got) __asm__ ( \
+ ".hidden " #sym " \n" \
+ " mfs %0, rpc \n" \
+ " addik %0, %0, _GLOBAL_OFFSET_TABLE_+8 \n" \
+ " addik %0, %0, " #sym "@GOTOFF \n" \
+ : "=r"(*(fp)) : : "memory" )