Runtime values to validate relocation?

Nick Clifton nickc@redhat.com
Tue Oct 27 13:29:00 GMT 2015


Hi Sivanupandi,

(Sorry for the delay in responding).

> Is there any way I could pass runtime values to resolve/ validate a
> relocation?

Yes, I think that this should be possible.

> For example, BFD_RELOC_AVR_PORT5 is a 5 bit reloc that stores an I/O register
> number (0..31) for the SBIC, SBIS, SBI and CBI instructions. Some device
> may restrict one or more IO registers for these instructions. These registers
> shall be specified by target specific emulation options.
> Can this registers mask be propagated to relocation resolve process so that
> users can be warned?

Yes.  You could add a linker command line option that takes a mask of 
the allowed registers, and then pass this on the AVR backend in the bfd 
library.

Take a look at the ARM linker for example.  It has a command line option 
  --stub-group=SIZE that accepts a size value (see 
ld/emultempl/armelf.em) and passes it to the bfd library via 
elf32_arm_size_stubs().

Cheers
   Nick




More information about the Binutils mailing list