Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
osv
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Verlässliche Systemsoftware
projects
osv
Commits
895c30a5
Commit
895c30a5
authored
12 years ago
by
Avi Kivity
Browse files
Options
Downloads
Patches
Plain Diff
elf: use paths for opening elf objects
dlopen() uses files, so do so as well. Change DT_NEEDED handling to add the path.
parent
ae138704
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
elf.cc
+3
-4
3 additions, 4 deletions
elf.cc
loader.cc
+1
-1
1 addition, 1 deletion
loader.cc
with
4 additions
and
5 deletions
elf.cc
+
3
−
4
View file @
895c30a5
...
...
@@ -490,7 +490,7 @@ namespace elf {
auto
needed
=
dynamic_str_array
(
DT_NEEDED
);
for
(
auto
lib
:
needed
)
{
debug
(
fmt
(
"needed: %1%"
)
%
lib
);
_prog
.
add
(
lib
);
_prog
.
add
(
std
::
string
(
"/usr/lib"
)
+
lib
);
}
}
...
...
@@ -543,12 +543,11 @@ namespace elf {
elf_object
*
program
::
add
(
std
::
string
name
)
{
if
(
!
_files
.
count
(
name
))
{
std
::
string
pathname
=
"/usr/lib/"
+
name
;
auto
f
(
_fs
.
open
(
pathname
));
auto
f
(
_fs
.
open
(
name
));
if
(
!
f
)
{
return
nullptr
;
}
auto
ef
=
new
elf_file
(
*
this
,
f
,
path
name
);
auto
ef
=
new
elf_file
(
*
this
,
f
,
name
);
ef
->
set_base
(
_next_alloc
);
_files
[
name
]
=
ef
;
ef
->
load_segments
();
...
...
This diff is collapsed.
Click to expand it.
loader.cc
+
1
−
1
View file @
895c30a5
...
...
@@ -164,7 +164,7 @@ int main(int ac, char **av)
void
main_thread
(
elf
::
program
&
prog
)
{
test_threads
();
prog
.
add
(
"libjvm.so"
);
prog
.
add
(
"
/usr/lib/
libjvm.so"
);
auto
JNI_GetDefaultJavaVMInitArgs
=
prog
.
lookup_function
<
void
(
void
*
)
>
(
"JNI_GetDefaultJavaVMInitArgs"
);
JavaVMInitArgs
vm_args
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment