cancel
Showing results for 
Search instead for 
Did you mean: 

relocation truncated to fit: R_ARM_THM_JUMP11

Aurélien f
Senior
Posted on May 24, 2017 at 14:34

Hello, 

I want to make a branch from startup file like this :

Default_Handler:

  b exception_panic

  .size Default_Handler, .-Default_Handler

But i'm getting this error : 

relocation truncated to fit: R_ARM_THM_JUMP11 against symbol `exception_panic' defined in .text.exception_panic section in Miscelleneous/src/panic.o

collect2: error: ld returned 1 exit status

Do i need to create a specific section that is close enough to my branch instruction so that the branch can be effective ?

Thank you,

Best regards,

Aurélien

3 REPLIES 3
Posted on May 24, 2017 at 15:49

Try using B.W form to force the long encoding.

You'll note that they frequently use 'ldr r0,=SystemInit, blx r0' form to allow a branch anywhere in the 32-bit address range via a literal, which the linker can then fixup.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Aurélien f
Senior
Posted on May 24, 2017 at 16:27

hi,

Thx for your reply. Actually i will use a bx instead of blx because i don't want to corrupt my LR register, i also wanted to keep my R0 registers unchanged for post analysing purpose but if it is not possible, it doesn't matter.

Thx

Aurélien

Posted on May 24, 2017 at 15:49

http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0489g/CIHFGAAD.html

 
Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..