aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/linker.h
diff options
context:
space:
mode:
authorBrandon Bergren <bdragon@FreeBSD.org>2019-12-24 15:56:24 +0000
committerBrandon Bergren <bdragon@FreeBSD.org>2019-12-24 15:56:24 +0000
commit7821a820d008a254bbe53b96f413c2ecab5af964 (patch)
tree73e191681897ba1cb5aaa4b97fb0cffb5b87f4a5 /sys/sys/linker.h
parentf5ead20562f4291602de68d2f13966caedd55093 (diff)
downloadsrc-7821a820d008a254bbe53b96f413c2ecab5af964.tar.gz
src-7821a820d008a254bbe53b96f413c2ecab5af964.zip
[PowerPC] Implement Secure-PLT jump table processing for ppc32.
Due to clang and LLD's tendency to use a PLT for builtins, and as they don't have full support for EABI, we sometimes have to deal with a PLT in .ko files in a clang-built kernel. As such, augment the in-kernel linker to support jump table processing. As there is no particular reason to support lazy binding in kernel modules, only implement Secure-PLT immediate binding. As part of these changes, add elf_cpu_parse_dynamic() to the MD API of the in-kernel linker (except on platforms that use raw object files.) The new function will allow MD code to act on MD tags in _DYNAMIC. Use this new function in the PowerPC MD code to ensure BSS-PLT modules using PLT will be rejected during insertion, and to poison the runtime resolver to ensure we get a clear panic reason if a call is made to the resolver. Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D22608
Notes
Notes: svn path=/head/; revision=356053
Diffstat (limited to 'sys/sys/linker.h')
-rw-r--r--sys/sys/linker.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/sys/linker.h b/sys/sys/linker.h
index 143d7473cf10..e48f4fd1c03b 100644
--- a/sys/sys/linker.h
+++ b/sys/sys/linker.h
@@ -305,6 +305,10 @@ int linker_ctf_get(linker_file_t, linker_ctf_t *);
int elf_cpu_load_file(linker_file_t);
int elf_cpu_unload_file(linker_file_t);
+/* amd64 and mips use objects instead of shared libraries */
+#if !defined(__amd64__) && !defined(__mips__)
+int elf_cpu_parse_dynamic(linker_file_t, Elf_Dyn *);
+#endif
/* values for type */
#define ELF_RELOC_REL 1