relaxation question
Dmitry Dikiy
DmitryD@astrosoft.ru
Wed Aug 11 10:38:00 GMT 2004
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.
More information about the Binutils
mailing list