MikhailProg/elf

BUG: AT_BASE incorrect for static-pie

Closed this issue · 1 comments

cat > test.c << EOF
#include <stdio.h>

int main() {
    printf("hello world");
    return 0;
}
EOF

gcc test.c -o test -static-pie -fPIE

./loader test
[1]    244579 segmentation fault (core dumped)  ./loader test

AT_BASE should reset to 0, if interpreter does not exist.

AVSET(AT_BASE, av, elf_interp ?
				base[Z_INTERP] : 0);

remove calling fini callback from ld.so it causes a crash, test.sh is added, tested with gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0