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
4a4cdafa
Commit
4a4cdafa
authored
10 years ago
by
Alessandro Di Federico
Browse files
Options
Downloads
Patches
Plain Diff
Link libmy against the loader's executable
parent
4cb309fa
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
CMakeLists.txt
+1
-12
1 addition, 12 deletions
CMakeLists.txt
README.md
+0
-1
0 additions, 1 deletion
README.md
eld.c
+1
-1
1 addition, 1 deletion
eld.c
with
2 additions
and
14 deletions
CMakeLists.txt
+
1
−
12
View file @
4a4cdafa
...
...
@@ -50,23 +50,12 @@ add_library(eld STATIC dl.c eld.c elf-object.c)
add_executable
(
loader test.c
)
target_link_libraries
(
loader eld
)
# Create a copy of the loader executable forcing it to a shared object
# so it can be dynamically linked against other shared libraries
add_custom_command
(
TARGET loader
POST_BUILD
COMMAND
${
CMAKE_COMMAND
}
-E copy
${
CMAKE_CURRENT_BINARY_DIR
}
/loader
${
CMAKE_CURRENT_BINARY_DIR
}
/main
COMMAND dd if=
${
CMAKE_CURRENT_SOURCE_DIR
}
/shared-library-id.bin
of=main seek=16 bs=1 conv=notrunc
)
# Test dynamic libraries
add_library
(
your SHARED libyour.c
)
add_library
(
my SHARED libmy.c
)
# Link libmy against libyour and the main executable
target_link_libraries
(
my your
":
main
"
)
target_link_libraries
(
my your
":
loader
"
)
add_dependencies
(
my loader
)
# Simulation targets
...
...
This diff is collapsed.
Click to expand it.
README.md
+
0
−
1
View file @
4a4cdafa
...
...
@@ -15,5 +15,4 @@ the previously loaded shared objects are searched in load order.
*
Import sys/queue.h
*
Add support for having different address spaces
*
Add support for TLS relocations
*
Let eld_init and eld_finish be called from crt
*
Documentation
This diff is collapsed.
Click to expand it.
eld.c
+
1
−
1
View file @
4a4cdafa
...
...
@@ -13,7 +13,7 @@ int eld_init() {
SLIST_INIT
(
&
elves
);
elf_object_t
*
main_elf
=
eld_elf_object_new
(
STR_PAR
(
"
main
"
));
elf_object_t
*
main_elf
=
eld_elf_object_new
(
STR_PAR
(
"
loader
"
));
RETURN_ON_NULL
(
main_elf
);
main_elf
->
dynamic_info_section
=
&
_DYNAMIC
;
RETURN_ON_ERROR
(
eld_elf_object_handle_dyn
(
main_elf
));
...
...
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