This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
relaxation question
- From: Dmitry Dikiy <DmitryD at astrosoft dot ru>
- To: binutils at sources dot redhat dot com
- Date: Wed, 11 Aug 2004 14:37:59 +0400
- Subject: relaxation question
Fellows,
I've got a question concerning relaxation technique.
My MPU has the following polymorphs:
jmp label ; displacement lett than +-512 bytes (1 word
instruction)
jmp label ; any dsplacement (2 words)
and some other. Obviously, opcodes of these two insns are different.
As I understand I have to fill 'const relax_typeS md_relax_table[]' with
something like:
{511,-512,4,1} and so on...
Then in md_estimate_size_before_relax() I have to return a delta between
assumed instruction and real instruction which depends on displacement
value.
In my case for 'jmp' this will be 2 or 0 if a displacement fits a single
word
instruction.
But, if the value of 'label' isn't known (it is defined in another file),
how can I do relaxation in this case? Will linker do it? If yes, then
XXX_elf_relax_section() will be called for every relaxation or for all
section?
Where I have to change an opcode if the instruction does not fit one word?
In md_convert_frag() ?
Thanks in davance,
Dmitry.