From owner-cvs-all@FreeBSD.ORG Fri Jun 18 02:02:38 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2B4A816A4CF; Fri, 18 Jun 2004 02:02:38 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 240E643D2D; Fri, 18 Jun 2004 02:02:38 +0000 (GMT) (envelope-from tmm@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id i5I21cpe071662; Fri, 18 Jun 2004 02:01:38 GMT (envelope-from tmm@repoman.freebsd.org) Received: (from tmm@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i5I21cTL071613; Fri, 18 Jun 2004 02:01:38 GMT (envelope-from tmm) Message-Id: <200406180201.i5I21cTL071613@repoman.freebsd.org> From: Thomas Moestl Date: Fri, 18 Jun 2004 02:01:38 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/libexec/rtld-elf rtld.csrc/libexec/rtld-elf/sparc64 rtld_machdep.h rtld_start.S X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jun 2004 02:02:38 -0000 tmm 2004-06-18 02:01:38 UTC FreeBSD src repository Modified files: libexec/rtld-elf rtld.c libexec/rtld-elf/sparc64 rtld_machdep.h rtld_start.S Log: Fix the problem that surfaced with the new binutils import on sparc64 (and that is for now being worked around by a binutils patch). The rtld code tested &_DYNAMIC against 0 to see whether rtld itself was built as PIC or not. While the sparc64 MD code did not rely on the preset value of the GOT slot for _DYNAMIC any more due to previous binutils changes, it still used to not be 0, so that this check did work. The new binutils do however initialize this slot with 0. As a consequence, rtld would not properly initialize itself and crash. Fix that by introducing a new macro, RTLD_IS_DYNAMIC, to take the role of this test. For sparc64, it is implemented using the rtld_dynamic() code that was already there. If an architecture does not provide its own implementation, we default to the old check. While being there, mark _DYNAMIC as a weak symbol in the sparc64 rtld_start.S. This is needed in the LDSCRIPT case, which is however not currently supported for want of an actual ldscript. Sanity checked with md5 on alpha, amd64, i386 and ia64. Revision Changes Path 1.97 +4 -1 src/libexec/rtld-elf/rtld.c 1.6 +3 -1 src/libexec/rtld-elf/sparc64/rtld_machdep.h 1.6 +3 -2 src/libexec/rtld-elf/sparc64/rtld_start.S