about port gas
Ian Lance Taylor
iant@google.com
Thu May 14 13:34:00 GMT 2009
daniel tian <daniel.xntian@gmail.com> writes:
> 1.md_apply_fix: How to trigger this function? I traced the source
> code with insight-gdb, but it doesn't go through in function.
It will be called by fixup_segment for every fixup for which the fx_done
field is not set to 1.
> 2. relax: I read the concept in "assembler Internals", it
> says"Relaxation is a generic term used when the size of instruction or
> data depends upon the value of the symbol or other data.". Does the
> "la" insn which is a pseudo instruction in mips satisfy this
> concept? As I know, if the symbol value or immediate data larger than
> 0xFFFF, this "la" will be achieved with two instructions(like LUI,
> LI).
Not really. Relaxation applies to instructions which can be implemented
in different sizes after the whole source is seen. A typical example is
a PC relative branch on a processor which supports different sizes of
branches, such as x86. The MIPS assembler backend does use relaxation
to select between different instruction sequences for accessing symbols
based on whether they are small or large, or local or global. See the
long comment in tc-mips.c before RELAX_ENCODE, and see the calls to
relax_start, relax_switch, relax_end.
> 3. tc_gen_reloc: in the assembler internal, this function is not
> discussed. I wonder what the function aim for.
It turns assembler fixups into zero or more BFD arelent structures,
which then become relocations in the output file.
Ian
More information about the Binutils
mailing list