This is the mail archive of the binutils@sources.redhat.com 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: relaxation question


On Wed, Aug 11, 2004 at 02:37:59PM +0400, Dmitry Dikiy wrote:
> 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?

Yes, in that case the assembler can't do relaxation, and you need to
implement relaxation in the linker.  bfd_relax_section is called for
each input section in turn, not for each relocation, then if any of the
calls resulted in "again" being set, the whole process is repeated.

> Where I have to change an opcode if the instruction does not fit one word?
> In md_convert_frag() ?

Yes, that's the correct place for assembler relaxation.  See tc-i386.c

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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