Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Musl
提交
427173b9
T
Third Party Musl
项目概览
OpenHarmony
/
Third Party Musl
1 年多 前同步成功
通知
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看板
提交
427173b9
编写于
7月 24, 2011
作者:
R
Rich Felker
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix resolution of weak symbols (hopefully right now) and vdso
上级
e91c375f
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
9 addition
and
3 deletion
+9
-3
src/ldso/dynlink.c
src/ldso/dynlink.c
+9
-3
未找到文件。
src/ldso/dynlink.c
浏览文件 @
427173b9
...
...
@@ -92,10 +92,12 @@ static Sym *lookup(const char *s, uint32_t h, Sym *syms, uint32_t *hashtab, char
}
#define OK_TYPES (1<<STT_NOTYPE | 1<<STT_OBJECT | 1<<STT_FUNC | 1<<STT_COMMON)
#define OK_BINDS (1<<STB_GLOBAL | 1<<STB_WEAK)
static
void
*
find_sym
(
struct
dso
*
dso
,
const
char
*
s
,
int
need_def
)
{
uint32_t
h
=
hash
(
s
);
void
*
def
=
0
;
if
(
h
==
0x6b366be
&&
!
strcmp
(
s
,
"dlopen"
))
rtld_used
=
1
;
if
(
h
==
0x6b3afd
&&
!
strcmp
(
s
,
"dlsym"
))
rtld_used
=
1
;
for
(;
dso
;
dso
=
dso
->
next
)
{
...
...
@@ -103,10 +105,13 @@ static void *find_sym(struct dso *dso, const char *s, int need_def)
if
(
!
dso
->
global
)
continue
;
sym
=
lookup
(
s
,
h
,
dso
->
syms
,
dso
->
hashtab
,
dso
->
strings
);
if
(
sym
&&
(
!
need_def
||
sym
->
st_shndx
)
&&
sym
->
st_value
&&
(
1
<<
(
sym
->
st_info
&
0xf
)
&
OK_TYPES
))
return
dso
->
base
+
sym
->
st_value
;
&&
(
1
<<
(
sym
->
st_info
&
0xf
)
&
OK_TYPES
)
&&
(
1
<<
(
sym
->
st_info
>>
4
)
&
OK_BINDS
))
{
def
=
dso
->
base
+
sym
->
st_value
;
if
(
sym
->
st_info
>>
4
==
STB_GLOBAL
)
break
;
}
}
return
0
;
return
def
;
}
static
void
do_relocs
(
unsigned
char
*
base
,
size_t
*
rel
,
size_t
rel_size
,
size_t
stride
,
Sym
*
syms
,
char
*
strings
,
struct
dso
*
dso
)
...
...
@@ -519,6 +524,7 @@ void *__dynlink(int argc, char **argv, size_t *got)
vdso
->
hashtab
=
(
void
*
)(
vdso
->
base
+
vdso_dyn
[
DT_HASH
]);
vdso
->
strings
=
(
void
*
)(
vdso
->
base
+
vdso_dyn
[
DT_STRTAB
]);
vdso
->
name
=
"linux-gate.so.1"
;
vdso
->
global
=
1
;
vdso
->
prev
=
lib
;
lib
->
next
=
vdso
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录