如果是Mint19.2系统(对应Ubuntu 18.04):
user@mint19:~$ cat hello.c
#include<stdio.h>
int main(){
printf("hello!\n");
return 0;
}
user@mint19:~$ gcc -o hello hello.c
user@mint19:~$ ./hello
hello!
user@mint19:~$ file hello
hello: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/l, for GNU/Linux 3.2.0, BuildID[sha1]=5b58c0bfb8b27791cf9c628c861e613a41b0bca7, not stripped
如果是Mint21.1系统(对应Ubuntu 22.04):
user@mint21:~$ cat hello.c
#include<stdio.h>
int main(){
printf("hello!\n");
return 0;
}
user@mint21:~$ gcc -o hello hello.c
user@mint21:~$ ./hello
hello!
user@mint21:~$ file hello
hello: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=9b3d52481c82082ae41d7596191ffb3e8d941c98, for GNU/Linux 3.2.0, not stripped
为什么会有这种不同,这个是在哪里设置的?