diff options
-rw-r--r-- | absl/base/dynamic_annotations.h | 21 | ||||
-rw-r--r-- | absl/base/policy_checks.h | 2 | ||||
-rw-r--r-- | absl/debugging/internal/elf_mem_image.cc | 22 |
3 files changed, 3 insertions, 42 deletions
diff --git a/absl/base/dynamic_annotations.h b/absl/base/dynamic_annotations.h index 3b6d6ef4..7e328d96 100644 --- a/absl/base/dynamic_annotations.h +++ b/absl/base/dynamic_annotations.h @@ -50,25 +50,6 @@ # define DYNAMIC_ANNOTATIONS_ENABLED 0 #endif -#if defined(__native_client__) - #include "nacl/dynamic_annotations.h" - - // Stub out the macros missing from the NaCl version. - #ifndef ANNOTATE_CONTIGUOUS_CONTAINER - #define ANNOTATE_CONTIGUOUS_CONTAINER(beg, end, old_mid, new_mid) - #endif - #ifndef ANNOTATE_RWLOCK_CREATE_STATIC - #define ANNOTATE_RWLOCK_CREATE_STATIC(lock) - #endif - #ifndef ADDRESS_SANITIZER_REDZONE - #define ADDRESS_SANITIZER_REDZONE(name) - #endif - #ifndef ANNOTATE_MEMORY_IS_UNINITIALIZED - #define ANNOTATE_MEMORY_IS_UNINITIALIZED(address, size) - #endif - -#else /* !__native_client__ */ - #if DYNAMIC_ANNOTATIONS_ENABLED != 0 /* ------------------------------------------------------------- @@ -404,6 +385,4 @@ inline T ANNOTATE_UNPROTECTED_READ(const volatile T &x) { /* NOLINT */ #undef ATTRIBUTE_IGNORE_READS_BEGIN #undef ATTRIBUTE_IGNORE_READS_END -#endif /* !__native_client__ */ - #endif /* ABSL_BASE_DYNAMIC_ANNOTATIONS_H_ */ diff --git a/absl/base/policy_checks.h b/absl/base/policy_checks.h index d634dac6..0a07fc03 100644 --- a/absl/base/policy_checks.h +++ b/absl/base/policy_checks.h @@ -86,7 +86,7 @@ // in May, 2010 and includes some functionality used in Google software // (for instance pthread_setname_np): // https://sourceware.org/ml/libc-alpha/2010-05/msg00000.html -#ifdef __GLIBC_PREREQ +#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) #if !__GLIBC_PREREQ(2, 12) #error "Minimum required version of glibc is 2.12." #endif diff --git a/absl/debugging/internal/elf_mem_image.cc b/absl/debugging/internal/elf_mem_image.cc index d6d51924..3f747e7f 100644 --- a/absl/debugging/internal/elf_mem_image.cc +++ b/absl/debugging/internal/elf_mem_image.cc @@ -121,7 +121,7 @@ const void *ElfMemImage::GetSymAddr(const ElfW(Sym) *sym) const { return reinterpret_cast<const void *>(sym->st_value); } ABSL_RAW_CHECK(link_base_ < sym->st_value, "symbol out of range"); - return GetTableElement<char>(ehdr_, 0, 1, sym->st_value) - link_base_; + return GetTableElement<char>(ehdr_, 0, 1, sym->st_value - link_base_); } const ElfW(Verdef) *ElfMemImage::GetVerdef(int index) const { @@ -161,10 +161,6 @@ void ElfMemImage::Init(const void *base) { if (!base) { return; } - const intptr_t base_as_uintptr_t = reinterpret_cast<uintptr_t>(base); - // Fake VDSO has low bit set. - const bool fake_vdso = ((base_as_uintptr_t & 1) != 0); - base = reinterpret_cast<const void *>(base_as_uintptr_t & ~1); const char *const base_as_char = reinterpret_cast<const char *>(base); if (base_as_char[EI_MAG0] != ELFMAG0 || base_as_char[EI_MAG1] != ELFMAG1 || base_as_char[EI_MAG2] != ELFMAG2 || base_as_char[EI_MAG3] != ELFMAG3) { @@ -224,21 +220,7 @@ void ElfMemImage::Init(const void *base) { reinterpret_cast<ElfW(Dyn) *>(dynamic_program_header->p_vaddr + relocation); for (; dynamic_entry->d_tag != DT_NULL; ++dynamic_entry) { - ElfW(Xword) value = dynamic_entry->d_un.d_val; - if (fake_vdso) { - // A complication: in the real VDSO, dynamic entries are not relocated - // (it wasn't loaded by a dynamic loader). But when testing with a - // "fake" dlopen()ed vdso library, the loader relocates some (but - // not all!) of them before we get here. - if (dynamic_entry->d_tag == DT_VERDEF) { - // The only dynamic entry (of the ones we care about) libc-2.3.6 - // loader doesn't relocate. - value += relocation; - } - } else { - // Real VDSO. Everything needs to be relocated. - value += relocation; - } + const ElfW(Xword) value = dynamic_entry->d_un.d_val + relocation; switch (dynamic_entry->d_tag) { case DT_HASH: hash_ = reinterpret_cast<ElfW(Word) *>(value); |