aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/linuxvdso
diff options
context:
space:
mode:
authorpyos <pyos@yandex-team.ru>2022-02-10 16:47:49 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:47:49 +0300
commitb031b9d140bcd39f4ef2764e24d37bee317aaf23 (patch)
treec0748b5dcbade83af788c0abfa89c0383d6b779c /contrib/libs/linuxvdso
parentef985e41af0868676d7a2275f1d90261253ddf3b (diff)
downloadydb-b031b9d140bcd39f4ef2764e24d37bee317aaf23.tar.gz
Restoring authorship annotation for <pyos@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/libs/linuxvdso')
-rw-r--r--contrib/libs/linuxvdso/fake.cpp8
-rw-r--r--contrib/libs/linuxvdso/interface.cpp38
-rw-r--r--contrib/libs/linuxvdso/interface.h4
-rw-r--r--contrib/libs/linuxvdso/original/elf_mem_image.cc2
-rw-r--r--contrib/libs/linuxvdso/original/vdso_support.cc22
-rw-r--r--contrib/libs/linuxvdso/original/vdso_support.h4
6 files changed, 39 insertions, 39 deletions
diff --git a/contrib/libs/linuxvdso/fake.cpp b/contrib/libs/linuxvdso/fake.cpp
index 8a91da7d48c..f75627feaae 100644
--- a/contrib/libs/linuxvdso/fake.cpp
+++ b/contrib/libs/linuxvdso/fake.cpp
@@ -3,7 +3,7 @@
size_t NVdso::Enumerate(TSymbol*, size_t) {
return 0;
}
-
-void* NVdso::Function(const char*, const char*) {
- return nullptr;
-}
+
+void* NVdso::Function(const char*, const char*) {
+ return nullptr;
+}
diff --git a/contrib/libs/linuxvdso/interface.cpp b/contrib/libs/linuxvdso/interface.cpp
index 5cf5ac5d7dd..1c8b92ad25f 100644
--- a/contrib/libs/linuxvdso/interface.cpp
+++ b/contrib/libs/linuxvdso/interface.cpp
@@ -1,7 +1,7 @@
#include "interface.h"
#include "original/vdso_support.h"
-#ifdef HAVE_VDSO_SUPPORT
+#ifdef HAVE_VDSO_SUPPORT
size_t NVdso::Enumerate(TSymbol* s, size_t len) {
if (!len) {
@@ -27,21 +27,21 @@ size_t NVdso::Enumerate(TSymbol* s, size_t len) {
return n;
}
-
-void* NVdso::Function(const char* name, const char* version) {
- base::VDSOSupport::SymbolInfo info;
- // Have to cast away the `const` to make this reinterpret_cast-able to a function pointer.
- return base::VDSOSupport().LookupSymbol(name, version, STT_FUNC, &info) ? (void*) info.address : nullptr;
-}
-
-#else
-
-size_t NVdso::Enumerate(TSymbol*, size_t) {
- return 0;
-}
-
-void* NVdso::Function(const char*, const char*) {
- return nullptr;
-}
-
-#endif
+
+void* NVdso::Function(const char* name, const char* version) {
+ base::VDSOSupport::SymbolInfo info;
+ // Have to cast away the `const` to make this reinterpret_cast-able to a function pointer.
+ return base::VDSOSupport().LookupSymbol(name, version, STT_FUNC, &info) ? (void*) info.address : nullptr;
+}
+
+#else
+
+size_t NVdso::Enumerate(TSymbol*, size_t) {
+ return 0;
+}
+
+void* NVdso::Function(const char*, const char*) {
+ return nullptr;
+}
+
+#endif
diff --git a/contrib/libs/linuxvdso/interface.h b/contrib/libs/linuxvdso/interface.h
index 9789241b942..97d7f113c11 100644
--- a/contrib/libs/linuxvdso/interface.h
+++ b/contrib/libs/linuxvdso/interface.h
@@ -21,6 +21,6 @@ namespace NVdso {
};
size_t Enumerate(TSymbol* s, size_t len);
-
- void* Function(const char* name, const char* version);
+
+ void* Function(const char* name, const char* version);
}
diff --git a/contrib/libs/linuxvdso/original/elf_mem_image.cc b/contrib/libs/linuxvdso/original/elf_mem_image.cc
index d271d4c443f..066fcba4e3f 100644
--- a/contrib/libs/linuxvdso/original/elf_mem_image.cc
+++ b/contrib/libs/linuxvdso/original/elf_mem_image.cc
@@ -191,7 +191,7 @@ void ElfMemImage::Init(const void *base) {
strsize_ = 0;
verdefnum_ = 0;
link_base_ = ~0L; // Sentinel: PT_LOAD .p_vaddr can't possibly be this.
- if (!base || base == kInvalidBase) {
+ if (!base || base == kInvalidBase) {
return;
}
const intptr_t base_as_uintptr_t = reinterpret_cast<uintptr_t>(base);
diff --git a/contrib/libs/linuxvdso/original/vdso_support.cc b/contrib/libs/linuxvdso/original/vdso_support.cc
index 87f5dabaf19..2977477398a 100644
--- a/contrib/libs/linuxvdso/original/vdso_support.cc
+++ b/contrib/libs/linuxvdso/original/vdso_support.cc
@@ -51,12 +51,12 @@
namespace base {
-const void *VDSOSupport::vdso_base_ = NULL;
+const void *VDSOSupport::vdso_base_ = NULL;
VDSOSupport::VDSOSupport()
- // If vdso_base_ is still set to NULL, we got here
+ // If vdso_base_ is still set to NULL, we got here
// before VDSOSupport::Init has been called. Call it now.
- : image_(Init()) {
+ : image_(Init()) {
}
// NOTE: we can't use GoogleOnceInit() below, because we can be
@@ -69,20 +69,20 @@ VDSOSupport::VDSOSupport()
// Finally, even if there is a race here, it is harmless, because
// the operation should be idempotent.
const void *VDSOSupport::Init() {
- if (vdso_base_ == NULL) {
+ if (vdso_base_ == NULL) {
// Valgrind zaps AT_SYSINFO_EHDR and friends from the auxv[]
// on stack, and so glibc works as if VDSO was not present.
// But going directly to kernel via /proc/self/auxv below bypasses
// Valgrind zapping. So we check for Valgrind separately.
if (RunningOnValgrind()) {
- vdso_base_ = ElfMemImage::kInvalidBase;
- return vdso_base_;
+ vdso_base_ = ElfMemImage::kInvalidBase;
+ return vdso_base_;
}
int fd = open("/proc/self/auxv", O_RDONLY);
if (fd == -1) {
// Kernel too old to have a VDSO.
- vdso_base_ = ElfMemImage::kInvalidBase;
- return vdso_base_;
+ vdso_base_ = ElfMemImage::kInvalidBase;
+ return vdso_base_;
}
ElfW(auxv_t) aux;
while (read(fd, &aux, sizeof(aux)) == sizeof(aux)) {
@@ -94,16 +94,16 @@ const void *VDSOSupport::Init() {
}
}
close(fd);
- if (vdso_base_ == NULL) {
+ if (vdso_base_ == NULL) {
// Didn't find AT_SYSINFO_EHDR in auxv[].
- vdso_base_ = ElfMemImage::kInvalidBase;
+ vdso_base_ = ElfMemImage::kInvalidBase;
}
}
return vdso_base_;
}
const void *VDSOSupport::SetBase(const void *base) {
- CHECK(base != NULL);
+ CHECK(base != NULL);
const void *old_base = vdso_base_;
vdso_base_ = base;
image_.Init(base);
diff --git a/contrib/libs/linuxvdso/original/vdso_support.h b/contrib/libs/linuxvdso/original/vdso_support.h
index 2b2b20c6d98..1ccf32c23b9 100644
--- a/contrib/libs/linuxvdso/original/vdso_support.h
+++ b/contrib/libs/linuxvdso/original/vdso_support.h
@@ -114,8 +114,8 @@ class VDSOSupport {
// Cached value of auxv AT_SYSINFO_EHDR, computed once.
// This is a tri-state:
- // 0 => value hasn't been determined yet.
- // kInvalidBase => there is no VDSO.
+ // 0 => value hasn't been determined yet.
+ // kInvalidBase => there is no VDSO.
// else => vma of VDSO Elf{32,64}_Ehdr.
//
// When testing with mock VDSO, low bit is set.