[Patch/RFA]: Patch to fix R_ARM_THM_JUMP24 relocation truncated bug

Alan Modra amodra@gmail.com
Fri Jan 15 00:34:00 GMT 2010


On Thu, Jan 14, 2010 at 02:01:11PM +0000, Matthew Gretton-Dann wrote:
>    HOWTO (R_ARM_THM_JUMP24,	/* type */
>  	 1,			/* rightshift */
>  	 2,			/* size (0 = byte, 1 = short, 2 = long) */
> -	 24,			/* bitsize */
> +	 25,			/* bitsize */
>  	 TRUE,			/* pc_relative */
>  	 0,			/* bitpos */
>  	 complain_overflow_signed,/* complain_on_overflow */

This is odd.  Normally, bitsize determines the allowed field value
after the rightshift has been applied.  Hmm, I see elf32-arm.c does
it's own checking for these relocs and gets it wrong.  It would be
better to leave bitsize as 24 and remove the right shift on the
reloc_signed_max calculation.  You'd then need to adjust the
R_ARM_THM_JUMP24 howto.

-- 
Alan Modra
Australia Development Lab, IBM



More information about the Binutils mailing list