[dyld] Do not resolve symbols from executables compiled with -fPIE. #9404
[dyld] Do not resolve symbols from executables compiled with -fPIE. #9404vgvassilev merged 3 commits intoroot-project:masterfrom
Conversation
|
Starting build on |
|
Starting build on |
|
Build failed on ROOT-performance-centos8-multicore/default. Failing tests: |
|
Build failed on mac11/cxx17. Warnings:
|
|
Starting build on |
|
Any chance to have a test? |
|
And: congrats for solving this! |
|
Build failed on mac11/cxx17. Failing tests: |
Executables that are compiled with fPIE means they are compiled in a position
independent manner and are almost indistinguishable from the shared objects. A
reasonably reliable way to find if this was a `pie executable` is to check the
`DF_1_PIE` in the dynamic section of ELF.
The pseudo-code is:
```
if DT_FLAGS_1 dynamic section entry is present
if DF_1_PIE is set in DT_FLAGS_1:
print pie executable
else
print shared object
```
See https://stackoverflow.com/questions/34519521/why-does-gcc-create-a-shared-object-instead-of-an-executable-binary-according-to/34522357#34522357
Fixes root-project#7366
Patch by Alexander Penev (@alexander-penev)
Patch by Alexander Penev (@alexander-penev).
|
Starting build on |
|
@Axel-Naumann ping. |
Axel-Naumann
left a comment
There was a problem hiding this comment.
Sorry for the late review - LGTM, thanks! (and see missing newline at EOF)
|
|
||
| int main() { | ||
| return 0; | ||
| } No newline at end of file |
There was a problem hiding this comment.
Newline at EOF?
| } | |
| } |
Executables that are compiled with fPIE means they are compiled in a position independent manner and are almost indistinguishable from the shared objects. A reasonably reliable way to find if this was a
pie executableis to check theDF_1_PIEin the dynamic section of ELF.The pseudo-code is:
Fixes #7366
Patch by Alexander Penev (@alexander-penev)