From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16371 invoked by alias); 13 Nov 2007 17:18:54 -0000 Received: (qmail 16363 invoked by uid 22791); 13 Nov 2007 17:18:53 -0000 X-Spam-Check-By: sourceware.org Received: from qmta07.emeryville.ca.mail.comcast.net (HELO QMTA07.emeryville.ca.mail.comcast.net) (76.96.30.64) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 13 Nov 2007 17:18:48 +0000 Received: from OMTA11.emeryville.ca.mail.comcast.net ([76.96.30.36]) by QMTA07.emeryville.ca.mail.comcast.net with comcast id CFsg1Y00F0mlR8U0108J00; Tue, 13 Nov 2007 17:18:49 +0000 Received: from lucon.org ([24.6.230.138]) by OMTA11.emeryville.ca.mail.comcast.net with comcast id CHJo1Y0092zoa480000000; Tue, 13 Nov 2007 17:18:49 +0000 X-Authority-Analysis: v=1.0 c=1 a=IitZhWS8MI_kFczYC6cA:9 a=MKbLsgweGbiKAblWuLVJU4os0A4A:4 a=dGJ0OcVc7YAA:10 a=yy9KgUaKM3IA:10 Received: by lucon.org (Postfix, from userid 500) id 9796CF828E; Tue, 13 Nov 2007 09:18:45 -0800 (PST) Date: Tue, 13 Nov 2007 17:18:00 -0000 From: "H.J. Lu" To: binutils@sources.redhat.com Subject: PATCH: PR ld/5303: splay-tree doesn't support 64bit value on 32bit host Message-ID: <20071113171845.GA22504@lucon.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.14 (2007-02-12) Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2007-11/txt/msg00135.txt.bz2 Current linker is broken on 32bit host with 64bit BFD. The problem is splay-tree doesn't support 64bit value on bit host, but arange-set.c uses splay-tree on bfd_vma. Fixing it isn't easy since splay-tree is also used in gcc. We can't use #ifdef in splay-tree.h in gcc due to lack of #ifdef in gengtype in gcc. This patch will abort the linker if it detects such situation. H.J. --- 2007-11-13 H.J. Lu PR ld/5303 * arange-set.c (arange_set_new): Abort if size of bfd_vma > size of splay_tree types. --- bfd/arange-set.c.vma 2007-09-21 09:16:17.000000000 -0700 +++ bfd/arange-set.c 2007-11-13 09:11:23.000000000 -0800 @@ -194,6 +194,14 @@ arange_set_new (arange_set_allocate_fn a splay_tree sp; splay_tree_delete_value_fn fn; + if (sizeof (bfd_vma) > sizeof (splay_tree_key) + || sizeof (bfd_vma) > sizeof (splay_tree_value)) + { + (*_bfd_error_handler) + (_("size of bfd_vma > size of splay_tree types")); + abort (); + } + /* Allocate space for arange structure. */ set = (arange_set) (*allocate_fn) (sizeof (struct arange_set_s), data);