未验证 提交 70d1b9d4 编写于 作者: O openharmony_ci 提交者: Gitee

!585 修复部分libc-test用例

Merge pull request !585 from maweiye/fix-libctest
......@@ -9,7 +9,7 @@ int main(int argc, char *argv[])
void (*f)(void);
char buf[512];
if (!t_pathrel(buf, sizeof buf, argv[0], "dlopen_dso.so")) {
if (!t_pathrel(buf, sizeof buf, argv[0], "libdlopen_dso.so")) {
t_error("failed to obtain relative path to dlopen_dso.so\n");
return 1;
}
......@@ -47,7 +47,7 @@ int main(int argc, char *argv[])
t_error("reopened dso should have the same symbols, want %p, got %p\n", i, i2);
if (*i2 != 2)
t_error("reopened dso should have the same symbols, want i2==2, got i2==%d\n", *i2);
if (dlclose(g))
if (!dlclose(g))
t_error("dlclose failed: %s\n", dlerror());
if (dlclose(h))
t_error("dlclose failed: %s\n", dlerror());
......
#include <dlfcn.h>
#include "test.h"
int main()
int main(int argc, char *argv[])
{
int i;
void *h;
......@@ -11,8 +11,10 @@ int main()
unsigned align;
unsigned long addr;
} *t;
char buf[512];
h = dlopen("src/functional/tls_align_dso.so", RTLD_LAZY);
t_pathrel(buf, sizeof buf, argv[0], "libtls_align_dso.so");
h = dlopen(buf, RTLD_LAZY);
if (!h)
t_error("dlopen failed\n");
t = dlsym(h, "t");
......
......@@ -2,13 +2,15 @@
#include <dlfcn.h>
#include "test.h"
int main()
int main(int argc, char *argv[])
{
void *h;
char *(*f)(void);
char *s;
char buf[512];
h = dlopen("src/functional/tls_init_dso.so", RTLD_NOW|RTLD_GLOBAL);
t_pathrel(buf, sizeof buf, argv[0], "libtls_init_dso.so");
h = dlopen(buf, RTLD_NOW|RTLD_GLOBAL);
if (!h)
t_error("dlopen failed: %s\n", dlerror());
f = dlsym(h, "gettls");
......
......@@ -29,7 +29,7 @@ int main()
for (i=0; i<N; i++)
T(!pthread_create(td+i, 0, start, 0));
T(mod = dlopen("tls_get_new-dtv_dso.so", RTLD_NOW));
T(mod = dlopen("libtls_get_new-dtv_dso.so", RTLD_NOW));
pthread_barrier_wait(&b);
for (i=0; i<N; i++)
......
......@@ -122,12 +122,12 @@ template("test_unittest") {
}
if (target_name == "tls_align") {
ldflags += [ "-Wl,-rpath=src/functional" ]
ldflags += [ "-Wl,-rpath=./" ]
libs += [ "//${root_out_dir}/${test_lib_dir}/libtls_align_dso.so" ]
}
if (target_name == "tls_init") {
ldflags += [ "-Wl,-rpath=src/functional" ]
ldflags += [ "-Wl,-rpath=./" ]
libs += [ "//${root_out_dir}/${test_lib_dir}/libtls_init_dso.so" ]
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册