[LLVMdev] [Patch] Let MC/ELF generate Thumb/Thumb-2 are properly
Koan-Sin Tan
koansin.tan at gmail.com
Fri May 13 17:58:05 PDT 2011
Jim,
Thanks, I'll do it accordingly.
Sent from my iPhone
On May 13, 2011, at 11:04 PM, Jim Grosbach <grosbach at apple.com> wrote:
> Hi Koan,
>
> In general, this looks OK to me. Please split the patch into separate pieces, one for each issue you're addressing, though. From your description, it sounds like this should be 4 patches. That way we have a cleaner revision history in svn.
>
> -Jim
>
> On May 12, 2011, at 10:42 PM, Koan-Sin Tan wrote:
>
>> Hi,
>>
>> We are trying to use clang as a drop-in replacement for the gcc come with
>> Android NDK. I found that MC/ELF doesn't not handle Thumb functions properly,
>> e.g., bit 0 of the function name in the .symtab is not set to 1, and some thumb
>> instructions are not generated correctly, e.g., the addresses for tBL/tBLX are
>> not calculated right.
>>
>> With that attached patch, we can compile and run some (not all) Android
>> NDK samples without problem.
>>
>> The attached initial patch
>> 1. sets bit 0 of the function address of thumb function in .symtab
>> ("T is 1 if the target symbol S has type STT_FUNC and the
>> symbol addresses a Thumb instruction ;it is 0 otherwise."
>> from "ELF for the ARM Architecture" 4.7.1.2)
>>
>> 2. fixes target address tBL and tBLX
>> 3. sets relocation type of tBL/tBLX to R_ARM_THM_CALL
>> (4.7.1.6)
>> 4. adds some attributes to attribute section when cpu is "xscale"
>> (this is what used in Android NDK, when architecture is ARMv5)
>>
>> --
>> // koan-sin tan
>> <llvm-thumb-elf-hack.diff3>_______________________________________________
>> LLVM Developers mailing list
>> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
More information about the llvm-dev
mailing list