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 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.





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