From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18039 invoked by alias); 26 Aug 2009 09:02:00 -0000 Received: (qmail 17890 invoked by uid 22791); 26 Aug 2009 09:01:59 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00 X-Spam-Check-By: sourceware.org Received: from eu1sys200aog103.obsmtp.com (HELO eu1sys200aog103.obsmtp.com) (207.126.144.115) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 26 Aug 2009 09:01:52 +0000 Received: from source ([164.129.1.35]) (using TLSv1) by eu1sys200aob103.postini.com ([207.126.147.11]) with SMTP ID DSNKSpT5/amfQBzKR/Z7nwoRuhItA+hxqqbZ@postini.com; Wed, 26 Aug 2009 09:01:52 UTC Received: from zeta.dmz-eu.st.com (ns2.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 077E61F4 for ; Wed, 26 Aug 2009 09:01:48 +0000 (GMT) Received: from mail2.gnb.st.com (mail2.gnb.st.com [164.129.119.59]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id A81DA4C1D5 for ; Wed, 26 Aug 2009 09:01:48 +0000 (GMT) Received: from [164.129.122.40] (gnx2504.gnb.st.com [164.129.122.40]) by mail2.gnb.st.com (MOS 3.8.7a) with ESMTP id DFO69031 (AUTH lyon); Wed, 26 Aug 2009 11:02:42 +0200 (CEST) Message-ID: <4A94F9FB.9070407@st.com> Date: Wed, 26 Aug 2009 10:39:00 -0000 From: Christophe LYON User-Agent: Thunderbird 2.0.0.22 (X11/20090605) MIME-Version: 1.0 To: binutils@sourceware.org Subject: Re: Fix Thumb-2 shared libraries References: <4A324BAC.7090702@redhat.com> <4A3255D9.9030906@st.com> <20090612140642.GA31950@caradoc.them.org> <4A32626C.8090407@st.com> <4A3658C4.3000800@st.com> <20090615175935.GA22200@caradoc.them.org> <4A390CF5.3000505@st.com> <20090617162337.GA9315@caradoc.them.org> <4A3A4DEF.5070704@st.com> <4A3A4E62.8030603@st.com> <20090825185158.GA2712@caradoc.them.org> In-Reply-To: <20090825185158.GA2712@caradoc.them.org> 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: 2009-08/txt/msg00477.txt.bz2 On 25.08.2009 20:51, Daniel Jacobowitz wrote: > Unfortunately, this patch breaks Thumb-2 shared libraries. Would you mind giving an example? > But now the symbol table still points to the Thumb code, and we've > marked the entry as STT_FUNC. It ends up without the ISA bit set. > This causes R_ARM_JUMP_SLOT relocations to jump to the target function > as if it were ARM code - does not work. I expected this part of allocate_dynrelocs() to be used only by CALL-like relocs, and thought it was better to fix the definition in one place, rather than several uses, which is error prone. > If I revert just this part of your patch, there is one additional > failure in the testsuite (thanks, as usual, for test cases!). We use > blx to branch to the PLT entry, so I assume that's what this hunk was > for. We have to change the use of the symbol in this case, rather > than the definition. Agreed. > The test still needs a fixup, because the version that's there now > would not work at runtime. It has: > > .* <__lib_func3_from_thumb>: > .*: e59fc000 ldr ip, \[pc, #0\] ; 1000364 <__lib_func3_from_thumb\+0x8> > .*: e08ff00c add pc, pc, ip > .*: feffff90 .word 0xfeffff90 > > That will branch to lib_func3 in ARM mode, but lib_func3 is a Thumb > function. > Good catch! Sorry not to have noticed this, despite having re-read my patch quite a few times before committing! > Here's a patch I'm testing for this failure. It seems OK, but I think you forgot to add a test case :-) Christophe.