summaryrefslogtreecommitdiffstats
path: root/linker
diff options
context:
space:
mode:
authorWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2016-12-12 14:59:47 +0100
committerWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2016-12-12 14:59:47 +0100
commit73049dc117da1f669fa7cee4004e69b3493a58c9 (patch)
tree37dafd236bb27b1c23f59c7ad41655212f7c0902 /linker
parent385816ce486622d72a8e56443b53ff8404d4ae3b (diff)
parent92595081575c82ace07201a3ea32004eba968c0b (diff)
downloadbionic-73049dc117da1f669fa7cee4004e69b3493a58c9.zip
bionic-73049dc117da1f669fa7cee4004e69b3493a58c9.tar.gz
bionic-73049dc117da1f669fa7cee4004e69b3493a58c9.tar.bz2
Merge branch 'cm-13.0' of https://github.com/CyanogenMod/android_bionic into replicant-6.0replicant-6.0-beta-0001replicant-6.0-alpha-0006replicant-6.0
Diffstat (limited to 'linker')
-rw-r--r--linker/linker.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/linker/linker.cpp b/linker/linker.cpp
index bc40cf1..99c02d8 100644
--- a/linker/linker.cpp
+++ b/linker/linker.cpp
@@ -2208,14 +2208,14 @@ bool soinfo::relocate(const VersionTracker& version_tracker, ElfRelIteratorT&& r
MARK(rel->r_offset);
TRACE_TYPE(RELO, "RELO R_X86_64_32 %08zx <- +%08zx %s", static_cast<size_t>(reloc),
static_cast<size_t>(sym_addr), sym_name);
- *reinterpret_cast<ElfW(Addr)*>(reloc) = sym_addr + addend;
+ *reinterpret_cast<Elf32_Addr*>(reloc) = sym_addr + addend;
break;
case R_X86_64_64:
count_relocation(kRelocRelative);
MARK(rel->r_offset);
TRACE_TYPE(RELO, "RELO R_X86_64_64 %08zx <- +%08zx %s", static_cast<size_t>(reloc),
static_cast<size_t>(sym_addr), sym_name);
- *reinterpret_cast<ElfW(Addr)*>(reloc) = sym_addr + addend;
+ *reinterpret_cast<Elf64_Addr*>(reloc) = sym_addr + addend;
break;
case R_X86_64_PC32:
count_relocation(kRelocRelative);
@@ -2223,7 +2223,7 @@ bool soinfo::relocate(const VersionTracker& version_tracker, ElfRelIteratorT&& r
TRACE_TYPE(RELO, "RELO R_X86_64_PC32 %08zx <- +%08zx (%08zx - %08zx) %s",
static_cast<size_t>(reloc), static_cast<size_t>(sym_addr - reloc),
static_cast<size_t>(sym_addr), static_cast<size_t>(reloc), sym_name);
- *reinterpret_cast<ElfW(Addr)*>(reloc) = sym_addr + addend - reloc;
+ *reinterpret_cast<Elf32_Addr*>(reloc) = sym_addr + addend - reloc;
break;
#elif defined(__arm__)
case R_ARM_ABS32:
@@ -3023,7 +3023,11 @@ bool soinfo::link_image(const soinfo_list_t& global_group, const soinfo_list_t&
#endif
// Make segments writable to allow text relocations to work properly. We will later call
// phdr_table_protect_segments() after all of them are applied and all constructors are run.
+#if defined(USE_LEGACY_BLOBS)
+ DEBUG("%s has text relocations. This is wasting memory and prevents "
+#else
DL_WARN("%s has text relocations. This is wasting memory and prevents "
+#endif
"security hardening. Please fix.", get_realpath());
if (phdr_table_unprotect_segments(phdr, phnum, load_bias) < 0) {
DL_ERR("can't unprotect loadable segments for \"%s\": %s",