File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
src/__support/OSUtil/linux
test/src/__support/OSUtil/linux Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -112,7 +112,8 @@ struct VDSOSymbolTable {
112
112
cpp::string_view name = sym.name ();
113
113
cpp::string_view version = sym.version ();
114
114
if (name.empty ())
115
- return ;
115
+ continue ;
116
+
116
117
for (size_t j = 0 ; j < symbol_count; ++j) {
117
118
if (name == strtab + symtab[j].st_name ) {
118
119
// we find a symbol with desired name
Original file line number Diff line number Diff line change 25
25
#include < sys/syscall.h>
26
26
27
27
namespace LIBC_NAMESPACE {
28
+ // For x86_64, we explicit that some traditional vdso symbols are indeed
29
+ // available.
28
30
29
31
TEST (LlvmLibcOSUtilVDSOTest, GetTimeOfDay) {
30
32
using FuncTy = int (*)(timeval *, struct timezone *);
31
33
vdso::Symbol symbol{vdso::VDSOSym::GetTimeOfDay};
32
34
auto func = symbol.get <FuncTy>();
35
+ #ifdef LIBC_TARGET_ARCH_IS_X86
36
+ ASSERT_NE (func, static_cast <FuncTy>(nullptr ));
37
+ #else
33
38
if (func == nullptr )
34
39
return ;
40
+ #endif
35
41
timeval tv;
36
42
EXPECT_EQ (func (&tv, nullptr ), 0 );
37
43
// hopefully people are not building time machines using our libc.
@@ -42,8 +48,12 @@ TEST(LlvmLibcOSUtilVDSOTest, Time) {
42
48
using FuncTy = time_t (*)(time_t *);
43
49
vdso::Symbol symbol{vdso::VDSOSym::Time};
44
50
auto func = symbol.get <FuncTy>();
51
+ #ifdef LIBC_TARGET_ARCH_IS_X86
52
+ ASSERT_NE (func, static_cast <FuncTy>(nullptr ));
53
+ #else
45
54
if (func == nullptr )
46
55
return ;
56
+ #endif
47
57
time_t a, b;
48
58
EXPECT_GT (func (&a), static_cast <time_t >(0 ));
49
59
EXPECT_GT (func (&b), static_cast <time_t >(0 ));
You can’t perform that action at this time.
0 commit comments