arm/177686: assertion failed in ld-elf.so.1 when invoking telnet with parameters (clang, EABI)
Andrew Turner
andrew at fubar.geek.nz
Mon Apr 8 06:30:02 UTC 2013
The following reply was made to PR arm/177686; it has been noted by GNATS.
From: Andrew Turner <andrew at fubar.geek.nz>
To: Ralf Wenk <iz-rpi03 at hs-karlsruhe.de>
Cc: freebsd-gnats-submit at FreeBSD.org, freebsd-arm at freebsd.org
Subject: Re: arm/177686: assertion failed in ld-elf.so.1 when invoking
telnet with parameters (clang, EABI)
Date: Mon, 8 Apr 2013 18:24:00 +1200
On Sun, 7 Apr 2013 09:15:08 GMT
Ralf Wenk <iz-rpi03 at hs-karlsruhe.de> wrote:
> Invoking telnet with parameters triggers an assertion failure:
>
> # telnet www.belwue.de 80
> ld-elf.so.1: assert
> failed: /home/rpi/src/libexec/rtldelf/rtld_lock.c:233 Abort (core
> dumped)
This is an issue with either llvm or out dynamic linker, I haven't
yet decided.
Normally llvm aligns the stack to an 8 byte boundary and generates code
that relies on this alignment, however for leaf functions the compiler
is allowed to only align to a 4 byte boundary.
The problem is when there are functions that, from the C code, appear to
be a leaf function however are not due to them calling other functions,
for example __aeabi_read_tp(). With a static binary this would not be
an issue, however with a dynamic libc it means, on the first call, we
enter the dynamic linker which assumes the stack is aligned.
One solution is to ensure the stack is aligned in the dynamic linker,
however I'm leaning towards llvm being broken in this case as it should
have aligned the stack correctly before calling another function as per
the ABI documentation, as the stack pointer must be 8 byte aligned at
any public interface.
Andrew
More information about the freebsd-arm
mailing list