Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 Apr 2013 18:24:00 +1200
From:      Andrew Turner <andrew@fubar.geek.nz>
To:        Ralf Wenk <iz-rpi03@hs-karlsruhe.de>
Cc:        freebsd-arm@freebsd.org, freebsd-gnats-submit@FreeBSD.org
Subject:   Re: arm/177686: assertion failed in ld-elf.so.1 when invoking telnet with parameters (clang, EABI)
Message-ID:  <20130408182400.426dcb93@bender>
In-Reply-To: <201304070915.r379F83s096494@red.freebsd.org>
References:  <201304070915.r379F83s096494@red.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 7 Apr 2013 09:15:08 GMT
Ralf Wenk <iz-rpi03@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130408182400.426dcb93>