Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
eld
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
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
or1k
eld
Commits
6f7d49c1
Commit
6f7d49c1
authored
10 years ago
by
Alessandro Di Federico
Browse files
Options
Downloads
Patches
Plain Diff
Test dlsym with non-function symbol
parent
2efc6c3a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+1
-2
1 addition, 2 deletions
README.md
libyour.c
+2
-0
2 additions, 0 deletions
libyour.c
test.c
+5
-1
5 additions, 1 deletion
test.c
with
8 additions
and
3 deletions
README.md
+
1
−
2
View file @
6f7d49c1
...
...
@@ -13,8 +13,7 @@ the previously loaded shared objects are searched in load order.
*
Import sys/queue.h
*
Add support for having different address spaces
*
Test dlsym with non-function symbols
*
Call fini function
*
Add support for TLS relocations
*
Let eld_init and eld_finish be called from crt
*
Documentation
\ No newline at end of file
*
Documentation
This diff is collapsed.
Click to expand it.
libyour.c
+
2
−
0
View file @
6f7d49c1
int
your_variable
=
0xbea7
;
int
your
()
{
return
99
;
}
This diff is collapsed.
Click to expand it.
test.c
+
5
−
1
View file @
6f7d49c1
...
...
@@ -22,7 +22,11 @@ int main() {
typedef
int
(
*
myfunc_ptr
)();
myfunc_ptr
myfunc
=
NULL
;
myfunc
=
dlsym
(
NULL
,
"my"
);
printf
(
"%d
\n
"
,
myfunc
());
int
*
libyour_variable
=
dlsym
(
NULL
,
"your_variable"
);
printf
(
"myfunc() == %d
\n
"
,
myfunc
());
printf
(
"your_variable == 0x%x
\n
"
,
*
libyour_variable
);
// Close the loaded libraries
RETURN_ON_ERROR
(
dlclose
(
libmy_handle
));
...
...
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