[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The fragS
structure is defined in `as.h'. Each frag represents a
portion of the final object file. As GAS reads the source file, it creates
frags to hold the data that it reads. At the end of the assembly the frags and
fixups are processed to produce the final contents.
fr_address
relax_segment
fills in this field.
fr_next
fr_fix
fr_var
fr_fix
characters. May be zero.
fr_offset
fr_type
. Generally,
if fr_var
is non-zero, this is a repeat count: the fr_var
characters are output fr_offset
times.
line
fr_type
fr_offset
,
fr_symbol
and the variable-length tail of the frag, as well as the
treatment it gets in various phases of processing. It does not affect the
initial fr_fix
characters; they are always supposed to be output
verbatim (fixups aside). See below for specific values this field can have.
fr_subtype
md_relax_frag
isn't defined, this is
assumed to be an index into TC_GENERIC_RELAX_TABLE
for the generic
relaxation code to process (see section 5. Relaxation). If md_relax_frag
is
defined, this field is available for any use by the CPU-specific code.
fr_symbol
fr_type
.
fr_opcode
tc_frag_data
TC_FRAG_TYPE
is defined.
fr_file
fr_line
fr_literal
These are the possible relaxation states, provided in the enumeration type
relax_stateT
, and the interpretations they represent for the other
fields:
rs_align
rs_align_code
fr_offset
is the logarithm (base 2) of the alignment in bytes.
(For example, if alignment on an 8-byte boundary were desired, fr_offset
would have a value of 3.) The variable characters indicate the fill pattern to
be used. The fr_subtype
field holds the maximum number of bytes to skip
when doing this alignment. If more bytes are needed, the alignment is not
done. An fr_subtype
value of 0 means no maximum, which is the normal
case. Target backends can use rs_align_code
to handle certain types of
alignment differently.
rs_broken_word
rs_cfa
fr_symbol
is an expression symbol for the subtraction which may be
relaxed. The fr_opcode
field holds the frag for the preceding command
byte. The fr_offset
field holds the offset within that frag. The
fr_subtype
field is used during relaxation to hold the current size of
the frag.
rs_fill
fr_offset
times. If
fr_offset
is 0, this frag has a length of fr_fix
. Most frags
have this type.
rs_leb128
fr_symbol
is always an expression
symbol, as constant expressions are emitted directly. The fr_offset
field is used during relaxation to hold the previous size of the number so
that we can determine if the fragment changed size.
rs_machine_dependent
fr_symbol
and fr_offset
, and fr_subtype
indicates the
particular machine-specific addressing mode desired. See section 5. Relaxation.
rs_org
fr_symbol
and fr_offset
; one
character from the variable-length tail is used as the fill character.
A chain of frags is built up for each subsection. The data structure
describing a chain is called a frchainS
, and contains the following
fields:
frch_root
frch_last
frch_next
frchainS
structures.
frch_seg
frch_subseg
fix_root, fix_tail
BFD_ASSEMBLER
is defined). Point to first and last
fixS
structures associated with this subsection.
frch_obstack
frch_frag_now
A frchainS
corresponds to a subsection; each section has a list of
frchainS
records associated with it. In most cases, only one subsection
of each section is used, so the list will only be one element long, but any
processing of frag chains should be prepared to deal with multiple chains per
section.
After the input files have been completely processed, and no more frags are to be generated, the frag chains are joined into one per section for further processing. After this point, it is safe to operate on one chain per section.
The assembler always has a current frag, named frag_now
. More space is
allocated for the current frag using the frag_more
function; this
returns a pointer to the amount of requested space. The function
frag_room
says by how much the current frag can be extended.
Relaxing is done using variant frags allocated by frag_var
or frag_variant
(see section 5. Relaxation).
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |