This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fix Thumb-2 shared libraries


On Wed, Aug 26, 2009 at 11:01:47AM +0200, Christophe LYON wrote:
> On 25.08.2009 20:51, Daniel Jacobowitz wrote:
>  > Unfortunately, this patch breaks Thumb-2 shared libraries.
> Would you mind giving an example?

Sure.  I built glibc as a Thumb-2 binary.  Because we change the type
of function symbols, calloc was marked as an ARM mode entry point in
ld.so's dynamic symbol table.  When ld.so resolves its own
relocations, it filled in an ARM-mode address in the PLT GOT.  So the
first call to calloc from ld.so caused us to execute Thumb code in ARM
mode.

> >Here's a patch I'm testing for this failure.
> It seems OK, but I think you forgot to add a test case :-)

I think your testcase serves nicely - now that I've fixed it to test
for correct behavior :-)

I'm going to wait for another internal test run before I commit this,
but it looks good so far.

-- 
Daniel Jacobowitz
CodeSourcery


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]