[PATCH] ELF/ARM: Ignore R_ARM_V4BX but allow linking

Adhemerval Zanella adhemerval.zanella at linaro.org
Wed Apr 15 06:25:19 PDT 2015


I am creating a test right now.  The problem relies that default GCC configuration
for arm-linux-gnueabi{hf} emits the relocation for the asm:

--
.syntax unified
.arm

.p2align 2
.type fn, %function
fn:
  ldr r3, .LGOT
  ldr r2, .LGOT+4
.LPIC:
  add r3, pc, r3
  ldr r2, [r3, r2]
  cmp r2, #0
  bxeq lr
  b __start__
.LGOT:
 .word _GLOBAL_OFFSET_TABLE_-(.LPIC+8)
 .word __start__(GOT)
--

But only if you use -march=armv4 (which is the default GCC configuration).  For
arm5 and forward the relocation is not created. This a special relocation 
(defined miscellaneous for ARM) that instruct the linker to replace the bx
instruction into a mov.  GNU linker has some options related to which substitution
it can create for such cases.

I am not sure of the status of ARM4 support for lld, but I think it should
not bail linking for this case in special.


On 14-04-2015 16:10, Shankar Kalpathi Easwaran wrote:
> Can you add a test ? How do you do that in assembly to create a relocation to nothing ?
> 
> 
> http://reviews.llvm.org/D9020
> 
> EMAIL PREFERENCES
>   http://reviews.llvm.org/settings/panel/emailpreferences/
> 
> 



More information about the llvm-commits mailing list