View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000093 | file | General | public | 2019-07-17 17:52 | 2019-07-23 08:51 |
Reporter | iaeiaeiaeiae@byom.de | Assigned To | christos | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | assigned | Resolution | open | ||
Product Version | 5.37 | ||||
Summary | 0000093: file incorrectly recognizes -static-pie binaries | ||||
Description | file recognizes binaries build with gcc using -static-pie as dynamically linked binaries. | ||||
Steps To Reproduce | 1. Create a simple hello word C program 2. Compile it using gcc -fPIE -static-pie -o test test.c 3. Run file on the resulting binary Output: test: ELF 64-bit LSB pie executable, x86-64, version 1 (GNU/Linux), dynamically linked, BuildID[sha1]=4594afb38f3f60aaad10d08ab519fcaeae55ee70, for GNU/Linux 3.2.0, not stripped It should actually be reported as statically linked, check with ldd: $ ldd test statically linked | ||||
Tags | No tags attached. | ||||
|
I can't reproduce this [5:04am] 10020>cc -static -fPIE -pie hello.c -o hello [5:04am] 10021>./file -m ../magic/magic.mgc ./hello ./hello: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, for GNU/Linux 2.6.32, BuildID[sha1]=f864bee36ab81bd40145389b987e8fe6b6d92696, not stripped [5:04am] 10022>./file --version file-5.37 magic file from /usr/local/share/misc/magic |
|
"-static -pie" and "-static-pie" are not the same thing. You need a relatively recent gcc for the latter https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=252034 I used gcc (GCC) 9.1.0. |
|
I don't have an environment like that available. Can you just attach a binary? |
|
The previous comment contained a binary. https://bugs.astron.com/file_download.php?file_id=64&type=bug |
Date Modified | Username | Field | Change |
---|---|---|---|
2019-07-17 17:52 | iaeiaeiaeiae@byom.de | New Issue | |
2019-07-21 09:04 | christos | Assigned To | => christos |
2019-07-21 09:04 | christos | Status | new => assigned |
2019-07-21 09:05 | christos | Status | assigned => feedback |
2019-07-21 09:05 | christos | Note Added: 0003260 | |
2019-07-22 18:29 | iaeiaeiaeiae@byom.de | File Added: testbin | |
2019-07-22 18:29 | iaeiaeiaeiae@byom.de | Note Added: 0003266 | |
2019-07-22 18:29 | iaeiaeiaeiae@byom.de | Status | feedback => assigned |
2019-07-22 20:43 | christos | Note Added: 0003267 | |
2019-07-23 08:51 | iaeiaeiaeiae@byom.de | Note Added: 0003268 |