From owner-svn-src-projects@FreeBSD.ORG Sun Feb 7 05:50:00 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4D151065672; Sun, 7 Feb 2010 05:50:00 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 788738FC19; Sun, 7 Feb 2010 05:50:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o175o0QR055962; Sun, 7 Feb 2010 05:50:00 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o175o0Qn055959; Sun, 7 Feb 2010 05:50:00 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201002070550.o175o0Qn055959@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 7 Feb 2010 05:50:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203602 - in projects/ppc64: contrib/binutils/bfd lib/libc/stdlib X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2010 05:50:00 -0000 Author: nwhitehorn Date: Sun Feb 7 05:50:00 2010 New Revision: 203602 URL: http://svn.freebsd.org/changeset/base/203602 Log: Revert r202955, which was the wrong solution to a binutils bug when processing TLS relocations in shared objects, and replace it with the correct solution. This patch is inspired by version 1.217 of upstream binutils. This commit fixes the problems with malloc TLS on powerpc64. Modified: projects/ppc64/contrib/binutils/bfd/elf64-ppc.c projects/ppc64/lib/libc/stdlib/malloc.c Modified: projects/ppc64/contrib/binutils/bfd/elf64-ppc.c ============================================================================== --- projects/ppc64/contrib/binutils/bfd/elf64-ppc.c Sun Feb 7 05:16:38 2010 (r203601) +++ projects/ppc64/contrib/binutils/bfd/elf64-ppc.c Sun Feb 7 05:50:00 2010 (r203602) @@ -3268,15 +3268,13 @@ create_got_section (bfd *abfd, struct bf flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_LINKER_CREATED); - got = bfd_get_section_by_name(abfd, ".got"); - if (!got) - got = bfd_make_section (abfd, ".got"); + got = bfd_make_section_anyway (abfd, ".got"); if (!got || !bfd_set_section_flags (abfd, got, flags) || !bfd_set_section_alignment (abfd, got, 3)) return FALSE; - relgot = bfd_make_section (abfd, ".rela.got"); + relgot = bfd_make_section_anyway (abfd, ".rela.got"); if (!relgot || ! bfd_set_section_flags (abfd, relgot, flags | SEC_READONLY) || ! bfd_set_section_alignment (abfd, relgot, 3)) Modified: projects/ppc64/lib/libc/stdlib/malloc.c ============================================================================== --- projects/ppc64/lib/libc/stdlib/malloc.c Sun Feb 7 05:16:38 2010 (r203601) +++ projects/ppc64/lib/libc/stdlib/malloc.c Sun Feb 7 05:50:00 2010 (r203602) @@ -253,7 +253,6 @@ __FBSDID("$FreeBSD$"); #ifdef __powerpc64__ # define QUANTUM_2POW 4 # define SIZEOF_PTR_2POW 3 -# define NO_TLS #elif defined(__powerpc__) # define QUANTUM_2POW 4 # define SIZEOF_PTR_2POW 2