Remove valgrind workarounds.
Bug: http://b/77856586
Test: ran 32-bit x86 tests on host
Change-Id: I98f6262bb1363ed5c8dd533b1f89b59b2b188525
diff --git a/libc/arch-x86/bionic/__libc_init_sysinfo.cpp b/libc/arch-x86/bionic/__libc_init_sysinfo.cpp
index f7c8c23..1bb7ab0 100644
--- a/libc/arch-x86/bionic/__libc_init_sysinfo.cpp
+++ b/libc/arch-x86/bionic/__libc_init_sysinfo.cpp
@@ -32,15 +32,8 @@
// This file is compiled without stack protection, because it runs before TLS
// has been set up.
-__LIBC_HIDDEN__ __attribute__((__naked__)) void __libc_int0x80() {
- __asm__ volatile("int $0x80; ret");
-}
-
__LIBC_HIDDEN__ void __libc_init_sysinfo(KernelArgumentBlock& args) {
- // Running under valgrind, AT_SYSINFO won't be set. http://b/77856586.
- void* at_sysinfo = reinterpret_cast<void*>(args.getauxval(AT_SYSINFO));
- __libc_sysinfo = (at_sysinfo != nullptr) ? at_sysinfo :
- reinterpret_cast<void*>(__libc_int0x80);
+ __libc_sysinfo = reinterpret_cast<void*>(args.getauxval(AT_SYSINFO));
}
// TODO: lose this function and just access __libc_sysinfo directly.
diff --git a/libc/bionic/getcwd.cpp b/libc/bionic/getcwd.cpp
index a8bbcf3..8ead91f 100644
--- a/libc/bionic/getcwd.cpp
+++ b/libc/bionic/getcwd.cpp
@@ -51,8 +51,6 @@
}
buf = allocated_buf = static_cast<char*>(malloc(allocated_size));
if (buf == NULL) {
- // malloc should set errno, but valgrind's malloc wrapper doesn't.
- errno = ENOMEM;
return NULL;
}
}
diff --git a/libc/bionic/libc_init_dynamic.cpp b/libc/bionic/libc_init_dynamic.cpp
index 6b8f57f..05b5535 100644
--- a/libc/bionic/libc_init_dynamic.cpp
+++ b/libc/bionic/libc_init_dynamic.cpp
@@ -65,6 +65,9 @@
// Use an initializer so __libc_sysinfo will have a fallback implementation
// while .preinit_array constructors run.
#if defined(__i386__)
+static __attribute__((__naked__)) void __libc_int0x80() {
+ __asm__ volatile("int $0x80; ret");
+}
__LIBC_HIDDEN__ void* __libc_sysinfo = reinterpret_cast<void*>(__libc_int0x80);
#endif
diff --git a/libc/private/bionic_globals.h b/libc/private/bionic_globals.h
index ad0244c..94dd7e8 100644
--- a/libc/private/bionic_globals.h
+++ b/libc/private/bionic_globals.h
@@ -50,7 +50,6 @@
#if defined(__i386__)
__LIBC_HIDDEN__ extern void* __libc_sysinfo;
-__LIBC_HIDDEN__ void __libc_int0x80();
__LIBC_HIDDEN__ void __libc_init_sysinfo(KernelArgumentBlock& args);
#endif