summaryrefslogtreecommitdiff
path: root/linker/linker.cpp
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2018-03-23 18:46:07 -0700
committerElliott Hughes <enh@google.com>2018-03-23 18:46:07 -0700
commit9724e93c196d0dbaa0e60bf45c29971a22da50c9 (patch)
tree0d3e0847bff250b168a0fcb2af431ba7fed097ee /linker/linker.cpp
parent4d339287080022ed67bb98949d7eb6737f8c917b (diff)
Reject .so files using ELF TLS.
Bug: http://b/74361956 Test: ran tests Change-Id: I53e71252eb08c607c2c436dcba433374c8c53887
Diffstat (limited to 'linker/linker.cpp')
-rw-r--r--linker/linker.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/linker/linker.cpp b/linker/linker.cpp
index dd700fe88..32df9113d 100644
--- a/linker/linker.cpp
+++ b/linker/linker.cpp
@@ -2784,6 +2784,11 @@ bool soinfo::relocate(const VersionTracker& version_tracker, ElfRelIteratorT&& r
}
}
#endif
+ if (ELF_ST_TYPE(s->st_info) == STT_TLS) {
+ DL_ERR("unsupported ELF TLS symbol \"%s\" referenced by \"%s\"",
+ sym_name, get_realpath());
+ return false;
+ }
sym_addr = lsi->resolve_symbol_address(s);
#if !defined(__LP64__)
if (protect_segments) {
@@ -3437,6 +3442,11 @@ bool soinfo::prelink_image() {
default:
if (!relocating_linker) {
+ if (d->d_tag == DT_TLSDESC_GOT || d->d_tag == DT_TLSDESC_PLT) {
+ DL_ERR("unsupported ELF TLS DT entry in \"%s\"", get_realpath());
+ return false;
+ }
+
const char* tag_name;
if (d->d_tag == DT_RPATH) {
tag_name = "DT_RPATH";