Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-static-pie ELF binary segfaults on aarch64 #382

Closed
sicherha opened this issue Mar 8, 2022 · 1 comment
Closed

-static-pie ELF binary segfaults on aarch64 #382

sicherha opened this issue Mar 8, 2022 · 1 comment

Comments

@sicherha
Copy link
Contributor

sicherha commented Mar 8, 2022

When building mold 1.1.1 (plus patch a20e3b8) for Fedora on aarch64, the hello-static-pie test case fails because the output binary crashes with a segmentation fault. This is unrelated to the problem addressed by a20e3b8, because glibc >= 2.35 is present on the system.

Unfortunately I don't have interactive access to aarch64 hardware, so all I can provide right now is a build log: https://download.copr.fedorainfracloud.org/results/sicherha/mold-aarch64-experiment/fedora-rawhide-aarch64/03637430-mold/builder-live.log.gz

+ CC=gcc
+ CXX=g++
++ basename ./elf/hello-static-pie.sh .sh
+ testname=hello-static-pie
Testing hello-static-pie ... + echo -n 'Testing hello-static-pie ... '
++ dirname ./elf/hello-static-pie.sh
+ cd ./elf/../..
++ pwd
+ mold=/builddir/build/BUILD/mold-1.1.1/mold
+ t=out/test/elf/hello-static-pie
+ mkdir -p out/test/elf/hello-static-pie
++ uname -m
+ '[' aarch64 = riscv64 ']'
+ gcc -o out/test/elf/hello-static-pie/exe -xc -
+ echo 'int main() {}'
+ ldd out/test/elf/hello-static-pie/exe
+ grep -q ld-musl
+ ldd --version
+ grep -Pq 'Copyright \(C\) 202[2-9]'
+ cat
+ gcc -o out/test/elf/hello-static-pie/a.o -c -xc - -fPIE
+ gcc -B. -o out/test/elf/hello-static-pie/exe out/test/elf/hello-static-pie/a.o -static-pie
+ out/test/elf/hello-static-pie/exe
./elf/hello-static-pie.sh: line 31:  3473 Segmentation fault      (core dumped) $t/exe
@rui314
Copy link
Owner

rui314 commented Mar 8, 2022

Thanks, I'll investigate. -static-pie is a relatively new feature, and it's overall a bit buggy.

@rui314 rui314 closed this as completed in 3d68824 Mar 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants