Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Musl
提交
891e6547
T
Third Party Musl
项目概览
OpenHarmony
/
Third Party Musl
接近 2 年 前同步成功
通知
37
Star
125
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Musl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
891e6547
编写于
1月 25, 2016
作者:
R
Rich Felker
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
move static-linked stub invalid dso handle checking out of dynlink.c
上级
4f8f0380
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
20 addition
and
9 deletion
+20
-9
src/ldso/dlerror.c
src/ldso/dlerror.c
+12
-0
src/ldso/dynlink.c
src/ldso/dynlink.c
+8
-9
未找到文件。
src/ldso/dlerror.c
浏览文件 @
891e6547
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
#include <stdlib.h>
#include <stdlib.h>
#include <stdarg.h>
#include <stdarg.h>
#include "pthread_impl.h"
#include "pthread_impl.h"
#include "libc.h"
char
*
dlerror
()
char
*
dlerror
()
{
{
...
@@ -50,3 +51,14 @@ void __dl_seterr(const char *fmt, ...)
...
@@ -50,3 +51,14 @@ void __dl_seterr(const char *fmt, ...)
__dl_vseterr
(
fmt
,
ap
);
__dl_vseterr
(
fmt
,
ap
);
va_end
(
ap
);
va_end
(
ap
);
}
}
__attribute__
((
__visibility__
(
"hidden"
)))
int
__dl_invalid_handle
(
void
*
);
static
int
stub_invalid_handle
(
void
*
h
)
{
__dl_seterr
(
"Invalid library handle %p"
,
(
void
*
)
h
);
return
1
;
}
weak_alias
(
stub_invalid_handle
,
__dl_invalid_handle
);
src/ldso/dynlink.c
浏览文件 @
891e6547
...
@@ -1733,7 +1733,8 @@ end:
...
@@ -1733,7 +1733,8 @@ end:
return
p
;
return
p
;
}
}
static
int
invalid_dso_handle
(
void
*
h
)
__attribute__
((
__visibility__
(
"hidden"
)))
int
__dl_invalid_handle
(
void
*
h
)
{
{
struct
dso
*
p
;
struct
dso
*
p
;
for
(
p
=
head
;
p
;
p
=
p
->
next
)
if
(
h
==
p
)
return
0
;
for
(
p
=
head
;
p
;
p
=
p
->
next
)
if
(
h
==
p
)
return
0
;
...
@@ -1788,7 +1789,7 @@ static void *do_dlsym(struct dso *p, const char *s, void *ra)
...
@@ -1788,7 +1789,7 @@ static void *do_dlsym(struct dso *p, const char *s, void *ra)
return
def
.
dso
->
funcdescs
+
(
def
.
sym
-
def
.
dso
->
syms
);
return
def
.
dso
->
funcdescs
+
(
def
.
sym
-
def
.
dso
->
syms
);
return
laddr
(
def
.
dso
,
def
.
sym
->
st_value
);
return
laddr
(
def
.
dso
,
def
.
sym
->
st_value
);
}
}
if
(
invalid_dso
_handle
(
p
))
if
(
__dl_invalid
_handle
(
p
))
return
0
;
return
0
;
if
((
ght
=
p
->
ghashtab
))
{
if
((
ght
=
p
->
ghashtab
))
{
gh
=
gnu_hash
(
s
);
gh
=
gnu_hash
(
s
);
...
@@ -1913,11 +1914,6 @@ int dl_iterate_phdr(int(*callback)(struct dl_phdr_info *info, size_t size, void
...
@@ -1913,11 +1914,6 @@ int dl_iterate_phdr(int(*callback)(struct dl_phdr_info *info, size_t size, void
return
ret
;
return
ret
;
}
}
#else
#else
static
int
invalid_dso_handle
(
void
*
h
)
{
error
(
"Invalid library handle %p"
,
(
void
*
)
h
);
return
1
;
}
void
*
dlopen
(
const
char
*
file
,
int
mode
)
void
*
dlopen
(
const
char
*
file
,
int
mode
)
{
{
error
(
"Dynamic loading not supported"
);
error
(
"Dynamic loading not supported"
);
...
@@ -1930,9 +1926,12 @@ void *__dlsym(void *restrict p, const char *restrict s, void *restrict ra)
...
@@ -1930,9 +1926,12 @@ void *__dlsym(void *restrict p, const char *restrict s, void *restrict ra)
}
}
#endif
#endif
__attribute__
((
__visibility__
(
"hidden"
)))
int
__dl_invalid_handle
(
void
*
);
int
__dlinfo
(
void
*
dso
,
int
req
,
void
*
res
)
int
__dlinfo
(
void
*
dso
,
int
req
,
void
*
res
)
{
{
if
(
invalid_dso
_handle
(
dso
))
return
-
1
;
if
(
__dl_invalid
_handle
(
dso
))
return
-
1
;
if
(
req
!=
RTLD_DI_LINKMAP
)
{
if
(
req
!=
RTLD_DI_LINKMAP
)
{
error
(
"Unsupported request %d"
,
req
);
error
(
"Unsupported request %d"
,
req
);
return
-
1
;
return
-
1
;
...
@@ -1943,7 +1942,7 @@ int __dlinfo(void *dso, int req, void *res)
...
@@ -1943,7 +1942,7 @@ int __dlinfo(void *dso, int req, void *res)
int
dlclose
(
void
*
p
)
int
dlclose
(
void
*
p
)
{
{
return
invalid_dso
_handle
(
p
);
return
__dl_invalid
_handle
(
p
);
}
}
__attribute__
((
__visibility__
(
"hidden"
)))
__attribute__
((
__visibility__
(
"hidden"
)))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录