This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Runtime values to validate relocation?
- From: Nick Clifton <nickc at redhat dot com>
- To: "Sivanupandi, Pitchumani" <Pitchumani dot Sivanupandi at atmel dot com>, "binutils at sourceware dot org" <binutils at sourceware dot org>
- Cc: Denis Chertykov <chertykov at gmail dot com>
- Date: Tue, 27 Oct 2015 13:29:48 +0000
- Subject: Re: Runtime values to validate relocation?
- Authentication-results: sourceware.org; auth=none
- References: <CAC140656783604CABA6AE60C2A6D5A4A2ED4931 at penmbx01>
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