[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.3 Fixups

A fixup is basically anything which can not be resolved in the first pass. Sometimes a fixup can be resolved by the end of the assembly; if not, the fixup becomes a relocation entry in the object file.

A fixup is created by a call to fix_new or fix_new_exp. Both take a frag (see section 2.4 Frags), a position within the frag, a size, an indication of whether the fixup is PC relative, and a type. In a BFD_ASSEMBLER GAS, the type is nominally a bfd_reloc_code_real_type, but several targets use other type codes to represent fixups that can not be described as relocations.

The fixS structure has a number of fields, several of which are obsolete or are only used by a particular target. The important fields are:

fx_frag
The frag (see section 2.4 Frags) this fixup is in.

fx_where
The location within the frag where the fixup occurs.

fx_addsy
The symbol this fixup is against. Typically, the value of this symbol is added into the object contents. This may be NULL.

fx_subsy
The value of this symbol is subtracted from the object contents. This is normally NULL.

fx_offset
A number which is added into the fixup.

fx_addnumber
Some CPU backends use this field to convey information between md_apply_fix3 and tc_gen_reloc. The machine independent code does not use it.

fx_next
The next fixup in the section.

fx_r_type
The type of the fixup. This field is only defined if BFD_ASSEMBLER, or if the target defines NEED_FX_R_TYPE.

fx_size
The size of the fixup. This is mostly used for error checking.

fx_pcrel
Whether the fixup is PC relative.

fx_done
Non-zero if the fixup has been applied, and no relocation entry needs to be generated.

fx_file
fx_line
The file and line where the fixup was created.

tc_fix_data
This has the type TC_FIX_TYPE, and is only defined if the target defines that macro.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated by system on December, 2 2004 using texi2html