This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Runtime values to validate relocation?


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]