aboutsummaryrefslogtreecommitdiff
path: root/sys/sys
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2021-01-17 07:03:31 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2021-01-21 12:55:31 +0000
commitf7d181543fd96a89b84878ddb2d5ac010fadd9b8 (patch)
tree2a3417f28a3bc100f5c7c84a919cbc6ba9c08da9 /sys/sys
parentff751ee05c939eceab25c26ad60b1d56f989aec9 (diff)
downloadsrc-f7d181543fd96a89b84878ddb2d5ac010fadd9b8.tar.gz
src-f7d181543fd96a89b84878ddb2d5ac010fadd9b8.zip
elf: add some definitions for i386 and amd64 relocations
I believe that rtld does not need to implement them, they are mostly for the static linker. 'Mostly' because for amd64 our kernel linker loads object files, and amd64 relocation types could be observed. Defines were taken from glibc sources. MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28205
Diffstat (limited to 'sys/sys')
-rw-r--r--sys/sys/elf_common.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/sys/sys/elf_common.h b/sys/sys/elf_common.h
index 5724397754e7..76bda8f71f3b 100644
--- a/sys/sys/elf_common.h
+++ b/sys/sys/elf_common.h
@@ -990,12 +990,17 @@ typedef struct {
#define R_386_RELATIVE 8 /* Add load address of shared object. */
#define R_386_GOTOFF 9 /* Add GOT-relative symbol address. */
#define R_386_GOTPC 10 /* Add PC-relative GOT table address. */
+#define R_386_32PLT 11
#define R_386_TLS_TPOFF 14 /* Negative offset in static TLS block */
#define R_386_TLS_IE 15 /* Absolute address of GOT for -ve static TLS */
#define R_386_TLS_GOTIE 16 /* GOT entry for negative static TLS block */
#define R_386_TLS_LE 17 /* Negative offset relative to static TLS */
#define R_386_TLS_GD 18 /* 32 bit offset to GOT (index,off) pair */
#define R_386_TLS_LDM 19 /* 32 bit offset to GOT (index,zero) pair */
+#define R_386_16 20
+#define R_386_PC16 21
+#define R_386_8 22
+#define R_386_PC8 23
#define R_386_TLS_GD_32 24 /* 32 bit offset to GOT (index,off) pair */
#define R_386_TLS_GD_PUSH 25 /* pushl instruction for Sun ABI GD sequence */
#define R_386_TLS_GD_CALL 26 /* call instruction for Sun ABI GD sequence */
@@ -1010,7 +1015,12 @@ typedef struct {
#define R_386_TLS_DTPMOD32 35 /* GOT entry containing TLS index */
#define R_386_TLS_DTPOFF32 36 /* GOT entry containing TLS offset */
#define R_386_TLS_TPOFF32 37 /* GOT entry of -ve static TLS offset */
+#define R_386_SIZE32 38
+#define R_386_TLS_GOTDESC 39
+#define R_386_TLS_DESC_CALL 40
+#define R_386_TLS_DESC 41
#define R_386_IRELATIVE 42 /* PLT entry resolved indirectly at runtime */
+#define R_386_GOT32X 43
#define R_AARCH64_NONE 0 /* No relocation */
#define R_AARCH64_ABS64 257 /* Absolute offset */
@@ -1472,6 +1482,10 @@ typedef struct {
#define R_X86_64_TLSDESC_CALL 35
#define R_X86_64_TLSDESC 36
#define R_X86_64_IRELATIVE 37
+#define R_X86_64_RELATIVE64 38
+/* 39 and 40 were BND-related, already decomissioned */
+#define R_X86_64_GOTPCRELX 41
+#define R_X86_64_REX_GOTPCRELX 42
#define ELF_BSDF_SIGFASTBLK 0x0001 /* Kernel supports fast sigblock */