Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Kevin
bionic
Commits
9ea64da6
Commit
9ea64da6
authored
15 years ago
by
Iliyan Malchev
Browse files
Options
Download
Email Patches
Plain Diff
bionic/linker: change lookup() to return soinfo, not base
parent
6ed80c88
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
9 deletions
+9
-9
linker/dlfcn.c
linker/dlfcn.c
+6
-6
linker/linker.c
linker/linker.c
+2
-2
linker/linker.h
linker/linker.h
+1
-1
No files found.
linker/dlfcn.c
View file @
9ea64da6
...
...
@@ -74,7 +74,7 @@ const char *dlerror(void)
void
*
dlsym
(
void
*
handle
,
const
char
*
symbol
)
{
unsigned
base
;
soinfo
*
found
;
Elf32_Sym
*
sym
;
unsigned
bind
;
...
...
@@ -90,19 +90,19 @@ void *dlsym(void *handle, const char *symbol)
}
if
(
handle
==
RTLD_DEFAULT
)
{
sym
=
lookup
(
symbol
,
&
base
);
sym
=
lookup
(
symbol
,
&
found
);
}
else
if
(
handle
==
RTLD_NEXT
)
{
sym
=
lookup
(
symbol
,
&
base
);
sym
=
lookup
(
symbol
,
&
found
);
}
else
{
sym
=
lookup_in_library
(
(
soinfo
*
)
handle
,
symbol
)
;
base
=
((
soinfo
*
)
handle
)
->
base
;
found
=
(
soinfo
*
)
handle
;
sym
=
lookup_in_library
(
found
,
symbol
)
;
}
if
(
likely
(
sym
!=
0
))
{
bind
=
ELF32_ST_BIND
(
sym
->
st_info
);
if
(
likely
((
bind
==
STB_GLOBAL
)
&&
(
sym
->
st_shndx
!=
0
)))
{
unsigned
ret
=
sym
->
st_value
+
base
;
unsigned
ret
=
sym
->
st_value
+
found
->
base
;
pthread_mutex_unlock
(
&
dl_lock
);
return
(
void
*
)
ret
;
}
...
...
This diff is collapsed.
Click to expand it.
linker/linker.c
View file @
9ea64da6
...
...
@@ -482,7 +482,7 @@ Elf32_Sym *lookup_in_library(soinfo *si, const char *name)
/* This is used by dl_sym(). It performs a global symbol lookup.
*/
Elf32_Sym
*
lookup
(
const
char
*
name
,
unsigned
*
base
)
Elf32_Sym
*
lookup
(
const
char
*
name
,
soinfo
**
found
)
{
unsigned
elf_hash
=
0
;
Elf32_Sym
*
s
=
NULL
;
...
...
@@ -494,7 +494,7 @@ Elf32_Sym *lookup(const char *name, unsigned *base)
continue
;
s
=
_do_lookup_in_so
(
si
,
name
,
&
elf_hash
);
if
(
s
!=
NULL
)
{
*
base
=
si
->
base
;
*
found
=
si
;
break
;
}
}
...
...
This diff is collapsed.
Click to expand it.
linker/linker.h
View file @
9ea64da6
...
...
@@ -203,7 +203,7 @@ extern soinfo libdl_info;
soinfo
*
find_library
(
const
char
*
name
);
unsigned
unload_library
(
soinfo
*
si
);
Elf32_Sym
*
lookup_in_library
(
soinfo
*
si
,
const
char
*
name
);
Elf32_Sym
*
lookup
(
const
char
*
name
,
unsigned
*
base
);
Elf32_Sym
*
lookup
(
const
char
*
name
,
soinfo
**
found
);
const
char
*
linker_get_error
(
void
);
#ifdef ANDROID_ARM_LINKER
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment