I’m trying to compile some assembly code (as part of Theora library) using XCode 4.2 and Apple LLVM compiller 3.0 (no thumb), but there are some errors in ldr(ne) instructions:
.text
.set DEC_OPB, 0xC944
ldrne r2, =258014 @ ERROR: Unsupported relocation on symbol L0. ERROR: Undefined local symbol 0 (0f or 0b)
ldr r6, =0x00800080 @ ERROR: Unsupported relocation on symbol L0.
ldr r5, =DEC_OPB @ ERROR: Unsupported relocation on symbol L0. ERROR: Undefined local symbol 0 (0f or 0b)
ldr r5, DEC_OPB @ ERROR: Bad immediate value for offset (51024). ERROR: Unsupported relocation on symbol (null)
Is it possible to override those lines with some other instructions? Or to replace them with constants?
Please help, because this post llvm-gcc assembler: LDR syntax didn’t help me to solve this problem.
when you do the ldr r2,=0x1234, the assembler looks for a place nearby to place that number and then uses a pc relative address to load it. If the assembler cannot find a place you get an error, I dont know if that is what the complaint was about. doesnt sound like the right error. The two solutions are the above where you explicitly place the values and not rely on the assembler, or you put a .pool or other similar directive in a branch shadow or some other place that you wont execute through to encourage the assembler to use it to place these kinds of constants.
I suspect from the error message something else may be going. post a reply or edit or question if that is the case.