From owner-cvs-src-old@FreeBSD.ORG Fri Mar 11 20:00:46 2011 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A51C3106564A for ; Fri, 11 Mar 2011 20:00:46 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 791E48FC1B for ; Fri, 11 Mar 2011 20:00:46 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.4/8.14.4) with ESMTP id p2BK0kAO048591 for ; Fri, 11 Mar 2011 20:00:46 GMT (envelope-from marius@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.4/8.14.4/Submit) id p2BK0kxt048590 for cvs-src-old@freebsd.org; Fri, 11 Mar 2011 20:00:46 GMT (envelope-from marius@repoman.freebsd.org) Message-Id: <201103112000.p2BK0kxt048590@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to marius@repoman.freebsd.org using -f From: Marius Strobl Date: Fri, 11 Mar 2011 20:00:38 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/contrib/binutils/bfd elfxx-sparc.c X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Mar 2011 20:00:46 -0000 marius 2011-03-11 20:00:38 UTC FreeBSD src repository Modified files: contrib/binutils/bfd elfxx-sparc.c Log: SVN rev 219530 on 2011-03-11 20:00:38Z by marius In the upstream rev. 1.61 of elf64-sparc.c the following bug was fixed: * elf64-sparc.c (sparc64_elf_relocate_section): Adjust addend of dynamic relocs against section symbols for the output section vma. However, with the addition of TLS support in the upstream rev. 1.104 this fix was essentially reverted. After factoring out the common parts of elf32-sparc.c and elf64-sparc.c a comment was added to elfxx-sparc.c in the upstream rev. 1.27 as part of unrelated changes, saying that the fix from elf64-sparc.c rev. 1.61 indeed should be implemented, but given that some unspecified OS has a broken ld.so expecting broken relocations deliberately is omitted. As the current behavior actually violates the SPARC ABI, FreeBSD never had such a broken ld.so and this is actually causing problems with at least kernel modules linked with binutils 2.17.50 committed in r218822 without the workaround committed in r219340 in place, re-implement the above fix in a way so that is only applied if the output format is ELFOSABI_FREEBSD. In the upstream version it probably would make sense to invert this check and only skip adjusting the addend for the OS with the broken ld.so, once it's determine which one that is. Approved by: dim Revision Changes Path 1.2 +11 -5 src/contrib/binutils/bfd/elfxx-sparc.c