[LLVMdev] Invalid relocation types for Thumb in LLVM version 2.9
PMon
pmon.mail at gmail.com
Sun Mar 4 00:08:16 PST 2012
Hi Nick
I have the same problem when compiling code with LLVM 2.9 and linking the
objects with the linker which comes with iOS SDK 4.2 (which can be found in
"/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/").
When you say "newer linker" can you elaborate which linker to use?
Thanks
PMon
Nick Kledzik wrote:
>
> The llvm compiler can now generated movt/movw instructions to create
> 32-bit constants. Those new instructions use new relocations. Mach-o
> uses different numbering for relocations than ELF does. For mach-o,
> ARM_RELOC_PAIR=1 and ARM_RELOC_HALF=8. You need a newer linker that
> understands the new relocations.
>
> -Nick
>
> On Feb 20, 2012, at 5:20 AM, Harel Cain wrote:
>> Hi all,
>>
>> I'm trying to figure out a problem with relocation types 1 and 8 (as
>> observed using otool -r on ARM/Thumb object files). Earlier, when I used
>> LLVM 2.8 with llc to generate thumb (-march=thumb -mattr=+thumb2)
>> assembly listings, then assemble those using the gcc of iPhone 4.2 SDK,
>> there wasn't any problem.
>>
>> However starting with LLVM 2.9, the same toolchain emits slightly
>> different assembly listings that after assembly into object files have
>> relocation entries of type 1 and 8 which the iPhonsOS 4.2 SDK linker
>> doesn't like (they produce warnings, and the linked binary crashes).
>>
>> According to http://simplemachines.it/doc/aaelf.pdf, these relocation
>> types are called R_ARM_PC24 and R_ARM_ABS8. They simply weren't created
>> with the assembly listings generated with LLVM 2.8.
>>
>> Anyone has any suggestion has to solve this? Is there any other toolchain
>> combination you can suggest in order to build Thumb object files for the
>> iOS/ARM platform? I'm not sure I'm even using LLVM the way I should here.
>>
>>
>> Many thanks!
>>
>>
>> Harel Cain
>>
>> _______________________________________________
>> LLVM Developers mailing list
>> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>
--
View this message in context: http://old.nabble.com/Invalid-relocation-types-for-Thumb-in-LLVM-version-2.9-tp33356625p33437362.html
Sent from the LLVM - Dev mailing list archive at Nabble.com.
More information about the llvm-dev
mailing list