From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19595 invoked by alias); 19 May 2006 00:11:18 -0000 Received: (qmail 19585 invoked by uid 22791); 19 May 2006 00:11:17 -0000 X-Spam-Check-By: sourceware.org Received: from bender.bawue.de (HELO bender.bawue.de) (193.7.176.20) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 19 May 2006 00:11:16 +0000 Received: from lagash (88-106-136-76.dynamic.dsl.as9105.com [88.106.136.76]) (using TLSv1 with cipher DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by bender.bawue.de (Postfix) with ESMTP id DC2464478E; Fri, 19 May 2006 02:11:12 +0200 (MEST) Received: from ths by lagash with local (Exim 4.62) (envelope-from ) id 1Fgsa6-0003Tg-0l; Fri, 19 May 2006 01:11:02 +0100 Date: Fri, 19 May 2006 09:12:00 -0000 To: David Daney Cc: Daniel Jacobowitz , binutils@sourceware.org Subject: Re: MIPS textrel fix Message-ID: <20060519001101.GA1073@networkno.de> References: <20060518213149.GA14720@nevyn.them.org> <446CEF9F.2070403@avtrex.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <446CEF9F.2070403@avtrex.com> User-Agent: Mutt/1.5.11+cvs20060403 From: Thiemo Seufer X-IsSubscribed: yes Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2006-05/txt/msg00321.txt.bz2 David Daney wrote: > Daniel Jacobowitz wrote: > >While stuck offline earlier today, I revisited the textrel-1 MIPS > >failure. Eric originally tried setting DF_TEXTREL during section > >relocation, but it's too late: we add the entry in size_dynamic_sections. > >But I couldn't see any other way to get it right, since there's no > >hook to predict whether elf-eh-frame.c will eliminate a relocation. > > > >The easiest approach I found was to annul the DT_TEXTREL and DT_FLAGS > >changes in finish_dynamic_sections if no text relocations were > >actually generated. This is not immensely pretty, but does work. > >OK? > > > >For background, the problem arises from the use of absolute addresses > >in .eh_frame. In this case, they're being produced by gas CFI > >directives. Is there a reason we can't mix and match encodings? > >i.e. why not have gas use a PC-relative format? I'm sure there's > >a reason, but I can't think of it... > > > > Could it be related to the reason that GCC no longer generates a > PC-relative .eh_frame? > > I never fully understood the reason, but I think it has to do with > MIPS-ELF specifications not allowing the needed relocation types (even > though they work well in binutils/glibc/linux). The needed relocation types were originally defined for embedded PIC MIPS and are not available in the ABI spec, their use for eh_frame was an accident. When the removal of embedded PIC support broke the toolchain, the fix chosen was to become ABI compatible again. Thiemo