Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 Apr 2013 06:30:01 GMT
From:      Andrew Turner <andrew@fubar.geek.nz>
To:        freebsd-arm@FreeBSD.org
Subject:   Re: arm/177686: assertion failed in ld-elf.so.1 when invoking telnet with parameters (clang, EABI)
Message-ID:  <201304080630.r386U124004014@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR arm/177686; it has been noted by GNATS.

From: Andrew Turner <andrew@fubar.geek.nz>
To: Ralf Wenk <iz-rpi03@hs-karlsruhe.de>
Cc: freebsd-gnats-submit@FreeBSD.org, freebsd-arm@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@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?201304080630.r386U124004014>