View Issue Details

IDProjectCategoryView StatusLast Update
0000499fileGeneralpublic2024-01-30 21:44
Reporterglebfm Assigned Tochristos  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version5.45 
Fixed in VersionHEAD 
Summary0000499: file misidentifies DSOs with FLAGS_1 tag as "static-pie linked"
Descriptionfile identifies an ELF shared object as "static-pie-linked" when any of the FLAGS_1 flags are set, not limited to the DF_1_PIE flag.
Steps To Reproduce$ gcc -shared -Wl,-zglobalaudit -xc /dev/null -o f
$ readelf -aW f | grep FLAGS_1
 0x000000006ffffffb (FLAGS_1) Flags: GLOBAUDIT
$ ./src/file -m magic/magic.mgc ./f
./f: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), static-pie linked, BuildID[sha1]=bc5733e07568cc022ce24849e147ff03d4746bfc, not stripped

$ gcc -shared -Wl,-Bgroup -xc /dev/null -o f
$ readelf -aW f | grep FLAGS_1
 0x000000006ffffffb (FLAGS_1) Flags: GROUP
$ ./src/file -m magic/magic.mgc ./f
./f: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), static-pie linked, BuildID[sha1]=a96bd0ff9b106623f0717fc8314206e77632f6d2, not stripped

$ gcc -shared -xc /dev/null -o f
$ readelf -aW f | grep FLAGS_1
$ ./src/file -m magic/magic.mgc ./f
./f: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=f82e2f8304d3239f6f9eb11115c1ed0a0b2ea00a, not stripped
TagsNo tags attached.

Activities

christos

2024-01-30 21:44

manager   ~0003992

Fixed, thanks. Funny on NetBSD DT_NEEDED is set, so I did not notice before.

Issue History

Date Modified Username Field Change
2024-01-23 12:33 glebfm New Issue
2024-01-30 21:43 christos Assigned To => christos
2024-01-30 21:43 christos Status new => assigned
2024-01-30 21:44 christos Status assigned => resolved
2024-01-30 21:44 christos Resolution open => fixed
2024-01-30 21:44 christos Fixed in Version => HEAD
2024-01-30 21:44 christos Note Added: 0003992