#996660 file: mistake statically linked PIE executables as dynamically linked

Package:
file
Source:
file
Description:
Recognize the type of data in a file using "magic" numbers
Submitter:
Ryutaroh Matsumoto
Date:
2021-10-16 23:57:03 UTC
Severity:
normal
#996660#5
Date:
2021-10-16 23:52:04 UTC
From:
To:
Dear Maintainer,

Statically linked PIE executable are mistaken as dynamically linked as below:

$ clang-13 -static -fPIE -static-pie hello.c
$ ldd a.out
	statically linked
$ file a.out
a.out: ELF 64-bit LSB pie executable, ARM aarch64, version 1 (GNU/Linux), dynamically linked, BuildID[sha1]=8fb93260326c669fd2b80d0863ca0c536d425c19, for GNU/Linux 3.7.0, not stripped

Best regards, Ryutaroh Matsumoto