From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13155 invoked by alias); 2 Dec 2011 08:44:04 -0000 Received: (qmail 13146 invoked by uid 22791); 2 Dec 2011 08:44:03 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=BAYES_00 X-Spam-Check-By: sourceware.org Received: from mail.synsport.com (HELO shepard.synsport.net) (208.69.230.148) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 02 Dec 2011 08:43:49 +0000 Received: from [192.168.0.11] (atoulouse-256-1-117-119.w90-45.abo.wanadoo.fr [90.45.4.119]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by shepard.synsport.net (Postfix) with ESMTP id 9F11143B91; Fri, 2 Dec 2011 02:43:47 -0600 (CST) Message-ID: <4ED88FA5.8050408@marino.st> Date: Fri, 02 Dec 2011 08:44:00 -0000 From: John Marino User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: Ian Lance Taylor CC: binutils@sourceware.org Subject: Re: gold linker 2.22 regressed for DragonFly References: <4ED7FCA6.8090706@marino.st> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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: 2011-12/txt/msg00020.txt.bz2 On 12/2/2011 5:58 AM, Ian Lance Taylor wrote: > John Marino writes: > > string_to_object_format is being called with a NULL pointer. > >> #1 0x000000000053b5e2 in format_enum (this=0x62a5fe) >> at ../../binutils-2.22/gold/options.cc:937 > This line is > return General_options::string_to_object_format(this->format()); > so this->format() is return a NULL string. > > That should not happen. this->format() is going to return the value of > this->format_.value. That should be initialized to "elf" and nothing > should ever change it to NULL. In this case "this" appears to refer to > the static variable Position_dependent_options::default_options_. > > I'm not aware of anything that has changed in this area between binutils > 2.21 and 2.22. The same code is in 2.21. > > I guess I would debug it by verifying that > Position_independent_options::default_options_.format_.value is in fact > initialized to "elf". If not, why not? If it is, when does it change? > > Ian I need to stress that gold built with ld does not have this problem. It's only gold built with gold that segfaults. Does that affect your answer? By the way, the format initialization is all happening via macro, so I had to "gcc -E" to even see what it's doing. The code looks fine to me. I'll try to analysis gold-by-gold with gdb later to see if I can get to the elf initiation or if it just skips it altogether. I suspect that it's never initialized. John