What is the difference between âLSB executableâ (ET_EXEC) and âLSB shared objectâ (ET_DYN)?

Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
With two files, one compiled and linked with gcc and the other manually with nasm and ld I get
- ELF 32-bit LSB shared object ...
- ELF 32-bit LSB executable ...
What's the difference between these two things? I can see with readelf -h that one is
- Type:
DYN (Shared object file) - Type:
EXEC (Executable file)
I can see these documented on Wikipedia as ET_DYN and ET_EXEC. What are the practical differences between these two?
gcc elf ld
add a comment |Â
up vote
0
down vote
favorite
With two files, one compiled and linked with gcc and the other manually with nasm and ld I get
- ELF 32-bit LSB shared object ...
- ELF 32-bit LSB executable ...
What's the difference between these two things? I can see with readelf -h that one is
- Type:
DYN (Shared object file) - Type:
EXEC (Executable file)
I can see these documented on Wikipedia as ET_DYN and ET_EXEC. What are the practical differences between these two?
gcc elf ld
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
With two files, one compiled and linked with gcc and the other manually with nasm and ld I get
- ELF 32-bit LSB shared object ...
- ELF 32-bit LSB executable ...
What's the difference between these two things? I can see with readelf -h that one is
- Type:
DYN (Shared object file) - Type:
EXEC (Executable file)
I can see these documented on Wikipedia as ET_DYN and ET_EXEC. What are the practical differences between these two?
gcc elf ld
With two files, one compiled and linked with gcc and the other manually with nasm and ld I get
- ELF 32-bit LSB shared object ...
- ELF 32-bit LSB executable ...
What's the difference between these two things? I can see with readelf -h that one is
- Type:
DYN (Shared object file) - Type:
EXEC (Executable file)
I can see these documented on Wikipedia as ET_DYN and ET_EXEC. What are the practical differences between these two?
gcc elf ld
gcc elf ld
edited Sep 30 at 21:23
Jeff Schaller
33.6k851113
33.6k851113
asked Sep 30 at 19:05
Evan Carroll
4,69493775
4,69493775
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
0
down vote
It seems this has something to do with Position Independent Executable (PIE). When GCC compiles executable by defaults it makes them PIE which changes the output flag on the ELF Header to ET_DYN.
You can disable the generation of PIE executables with
gcc -no-pie
If you're seeing this check the default options gcc is configured with gcc -v, you should see something like --enable-default-pie.
Answer inspired by this submission on StackOverflow. I intend to play more with it and explain more here.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
It seems this has something to do with Position Independent Executable (PIE). When GCC compiles executable by defaults it makes them PIE which changes the output flag on the ELF Header to ET_DYN.
You can disable the generation of PIE executables with
gcc -no-pie
If you're seeing this check the default options gcc is configured with gcc -v, you should see something like --enable-default-pie.
Answer inspired by this submission on StackOverflow. I intend to play more with it and explain more here.
add a comment |Â
up vote
0
down vote
It seems this has something to do with Position Independent Executable (PIE). When GCC compiles executable by defaults it makes them PIE which changes the output flag on the ELF Header to ET_DYN.
You can disable the generation of PIE executables with
gcc -no-pie
If you're seeing this check the default options gcc is configured with gcc -v, you should see something like --enable-default-pie.
Answer inspired by this submission on StackOverflow. I intend to play more with it and explain more here.
add a comment |Â
up vote
0
down vote
up vote
0
down vote
It seems this has something to do with Position Independent Executable (PIE). When GCC compiles executable by defaults it makes them PIE which changes the output flag on the ELF Header to ET_DYN.
You can disable the generation of PIE executables with
gcc -no-pie
If you're seeing this check the default options gcc is configured with gcc -v, you should see something like --enable-default-pie.
Answer inspired by this submission on StackOverflow. I intend to play more with it and explain more here.
It seems this has something to do with Position Independent Executable (PIE). When GCC compiles executable by defaults it makes them PIE which changes the output flag on the ELF Header to ET_DYN.
You can disable the generation of PIE executables with
gcc -no-pie
If you're seeing this check the default options gcc is configured with gcc -v, you should see something like --enable-default-pie.
Answer inspired by this submission on StackOverflow. I intend to play more with it and explain more here.
answered Sep 30 at 19:14
Evan Carroll
4,69493775
4,69493775
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f472449%2fwhat-is-the-difference-between-lsb-executable-et-exec-and-lsb-shared-object%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password