⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 internals.texi

📁 基于4个mips核的noc设计
💻 TEXI
📖 第 1 页 / 共 5 页
字号:
Return whether a symbol was used in an expression.@item symbol_mark_used_in_reloc@cindex symbol_mark_used_in_relocMark a symbol as having been used by a relocation.@item symbol_clear_used_in_reloc@cindex symbol_clear_used_in_relocClear the mark indicating that a symbol was used in a relocation.@item symbol_used_in_reloc_p@cindex symbol_used_in_reloc_pReturn whether a symbol was used in a relocation.@item symbol_mark_mri_common@cindex symbol_mark_mri_commonMark a symbol as an MRI common symbol.@item symbol_clear_mri_common@cindex symbol_clear_mri_commonClear the mark indicating that a symbol is an MRI common symbol.@item symbol_mri_common_p@cindex symbol_mri_common_pReturn whether a symbol is an MRI common symbol.@item symbol_mark_written@cindex symbol_mark_writtenMark a symbol as having been written.@item symbol_clear_written@cindex symbol_clear_writtenClear the mark indicating that a symbol was written.@item symbol_written_p@cindex symbol_written_pReturn whether a symbol was written.@item symbol_mark_resolved@cindex symbol_mark_resolvedMark a symbol as having been resolved.@item symbol_resolved_p@cindex symbol_resolved_pReturn whether a symbol has been resolved.@item symbol_section_p@cindex symbol_section_pReturn whether a symbol is a section symbol.@item symbol_equated_p@cindex symbol_equated_pReturn whether a symbol is equated to another symbol.@item symbol_constant_p@cindex symbol_constant_pReturn whether a symbol has a constant value, including being an offset withinsome frag.@item symbol_get_bfdsym@cindex symbol_get_bfdsymReturn the BFD symbol associated with a symbol.@item symbol_set_bfdsym@cindex symbol_set_bfdsymSet the BFD symbol associated with a symbol.@item symbol_get_obj@cindex symbol_get_objReturn a pointer to the @code{OBJ_SYMFIELD_TYPE} field of a symbol.@item symbol_set_obj@cindex symbol_set_objSet the @code{OBJ_SYMFIELD_TYPE} field of a symbol.@item symbol_get_tc@cindex symbol_get_tcReturn a pointer to the @code{TC_SYMFIELD_TYPE} field of a symbol.@item symbol_set_tc@cindex symbol_set_tcSet the @code{TC_SYMFIELD_TYPE} field of a symbol.@end tableWhen @code{BFD_ASSEMBLER} is defined, GAS attempts to store localsymbols--symbols which will not be written to the output file--using adifferent structure, @code{struct local_symbol}.  This structure can onlyrepresent symbols whose value is an offset within a frag.Code outside of the symbol handler will always deal with @code{symbolS}structures and use the accessor functions.  The accessor functions correctlydeal with local symbols.  @code{struct local_symbol} is much smaller than@code{symbolS} (which also automatically creates a bfd @code{asymbol}structure), so this saves space when assembling large files.The first field of @code{symbolS} is @code{bsym}, the pointer to the BFDsymbol.  The first field of @code{struct local_symbol} is a pointer which isalways set to NULL.  This is how the symbol accessor functions can distinguishlocal symbols from ordinary symbols.  The symbol accessor functionsautomatically convert a local symbol into an ordinary symbol when necessary.@node Expressions@subsection Expressions@cindex internals, expressions@cindex expressions, internal@cindex expressionS structureExpressions are stored in an @code{expressionS} structure.  The structure isdefined in @file{expr.h}.@cindex expressionThe macro @code{expression} will create an @code{expressionS} structure basedon the text found at the global variable @code{input_line_pointer}.@cindex make_expr_symbol@cindex expr_symbol_whereA single @code{expressionS} structure can represent a single operation.Complex expressions are formed by creating @dfn{expression symbols} andcombining them in @code{expressionS} structures.  An expression symbol iscreated by calling @code{make_expr_symbol}.  An expression symbol shouldnaturally never appear in a symbol table, and the implementation of@code{S_IS_LOCAL} (@pxref{Symbols}) reflects that.  The function@code{expr_symbol_where} returns non-zero if a symbol is an expression symbol,and also returns the file and line for the expression which caused it to becreated.The @code{expressionS} structure has two symbol fields, a number field, anoperator field, and a field indicating whether the number is unsigned.The operator field is of type @code{operatorT}, and describes how to interpretthe other fields; see the definition in @file{expr.h} for the possibilities.An @code{operatorT} value of @code{O_big} indicates either a floating pointnumber, stored in the global variable @code{generic_floating_point_number}, oran integer too large to store in an @code{offsetT} type, stored in the globalarray @code{generic_bignum}.  This rather inflexible approach makes itimpossible to use floating point numbers or large expressions in complexexpressions.@node Fixups@subsection Fixups@cindex internals, fixups@cindex fixups@cindex fixS structureA @dfn{fixup} is basically anything which can not be resolved in the firstpass.  Sometimes a fixup can be resolved by the end of the assembly; if not,the fixup becomes a relocation entry in the object file.@cindex fix_new@cindex fix_new_expA fixup is created by a call to @code{fix_new} or @code{fix_new_exp}.  Bothtake a frag (@pxref{Frags}), a position within the frag, a size, an indicationof whether the fixup is PC relative, and a type.  In a @code{BFD_ASSEMBLER}GAS, the type is nominally a @code{bfd_reloc_code_real_type}, but severaltargets use other type codes to represent fixups that can not be described asrelocations.The @code{fixS} structure has a number of fields, several of which are obsoleteor are only used by a particular target.  The important fields are:@table @code@item fx_fragThe frag (@pxref{Frags}) this fixup is in.@item fx_whereThe location within the frag where the fixup occurs.@item fx_addsyThe symbol this fixup is against.  Typically, the value of this symbol is addedinto the object contents.  This may be NULL.@item fx_subsyThe value of this symbol is subtracted from the object contents.  This isnormally NULL.@item fx_offsetA number which is added into the fixup.@item fx_addnumberSome CPU backends use this field to convey information between@code{md_apply_fix} and @code{tc_gen_reloc}.  The machine independent code doesnot use it.@item fx_nextThe next fixup in the section.@item fx_r_typeThe type of the fixup.  This field is only defined if @code{BFD_ASSEMBLER}, orif the target defines @code{NEED_FX_R_TYPE}.@item fx_sizeThe size of the fixup.  This is mostly used for error checking.@item fx_pcrelWhether the fixup is PC relative.@item fx_doneNon-zero if the fixup has been applied, and no relocation entry needs to begenerated.@item fx_file@itemx fx_lineThe file and line where the fixup was created.@item tc_fix_dataThis has the type @code{TC_FIX_TYPE}, and is only defined if the target definesthat macro.@end table@node Frags@subsection Frags@cindex internals, frags@cindex frags@cindex fragS structure.The @code{fragS} structure is defined in @file{as.h}.  Each frag represents aportion of the final object file.  As GAS reads the source file, it createsfrags to hold the data that it reads.  At the end of the assembly the frags andfixups are processed to produce the final contents.@table @code@item fr_addressThe address of the frag.  This is not set until the assembler rescans the listof all frags after the entire input file is parsed.  The function@code{relax_segment} fills in this field.@item fr_nextPointer to the next frag in this (sub)section.@item fr_fixFixed number of characters we know we're going to emit to the output file.  Maybe zero.@item fr_varVariable number of characters we may output, after the initial @code{fr_fix}characters.  May be zero.@item fr_offsetThe interpretation of this field is controlled by @code{fr_type}.  Generally,if @code{fr_var} is non-zero, this is a repeat count: the @code{fr_var}characters are output @code{fr_offset} times.@item lineHolds line number info when an assembler listing was requested.@item fr_typeRelaxation state.  This field indicates the interpretation of @code{fr_offset},@code{fr_symbol} and the variable-length tail of the frag, as well as thetreatment it gets in various phases of processing.  It does not affect theinitial @code{fr_fix} characters; they are always supposed to be outputverbatim (fixups aside).  See below for specific values this field can have.@item fr_subtypeRelaxation substate.  If the macro @code{md_relax_frag} isn't defined, this isassumed to be an index into @code{TC_GENERIC_RELAX_TABLE} for the genericrelaxation code to process (@pxref{Relaxation}).  If @code{md_relax_frag} isdefined, this field is available for any use by the CPU-specific code.@item fr_symbolThis normally indicates the symbol to use when relaxing the frag according to@code{fr_type}.@item fr_opcodePoints to the lowest-addressed byte of the opcode, for use in relaxation.@item tc_frag_dataTarget specific fragment data of type TC_FRAG_TYPE.Only present if @code{TC_FRAG_TYPE} is defined.@item fr_file@itemx fr_lineThe file and line where this frag was last modified.@item fr_literalDeclared as a one-character array, this last field grows arbitrarily large tohold the actual contents of the frag.@end tableThese are the possible relaxation states, provided in the enumeration type@code{relax_stateT}, and the interpretations they represent for the otherfields:@table @code@item rs_align@itemx rs_align_codeThe start of the following frag should be aligned on some boundary.  In thisfrag, @code{fr_offset} is the logarithm (base 2) of the alignment in bytes.(For example, if alignment on an 8-byte boundary were desired, @code{fr_offset}would have a value of 3.)  The variable characters indicate the fill pattern tobe used.  The @code{fr_subtype} field holds the maximum number of bytes to skipwhen doing this alignment.  If more bytes are needed, the alignment is notdone.  An @code{fr_subtype} value of 0 means no maximum, which is the normalcase.  Target backends can use @code{rs_align_code} to handle certain types ofalignment differently.@item rs_broken_wordThis indicates that ``broken word'' processing should be done (@pxref{Brokenwords}).  If broken word processing is not necessary on the target machine,this enumerator value will not be defined.@item rs_cfaThis state is used to implement exception frame optimizations.  The@code{fr_symbol} is an expression symbol for the subtraction which may berelaxed.  The @code{fr_opcode} field holds the frag for the preceding commandbyte.  The @code{fr_offset} field holds the offset within that frag.  The@code{fr_subtype} field is used during relaxation to hold the current size ofthe frag.@item rs_fillThe variable characters are to be repeated @code{fr_offset} times.  If@code{fr_offset} is 0, this frag has a length of @code{fr_fix}.  Most fragshave this type.@item rs_leb128This state is used to implement the DWARF ``little endian base 128''variable length number format.  The @code{fr_symbol} is always an expressionsymbol, as constant expressions are emitted directly.  The @code{fr_offset}field is used during relaxation to hold the previous size of the number sothat we can determine if the fragment changed size.@item rs_machine_dependentDisplacement relaxation is to be done on this frag.  The target is indicated by@code{fr_symbol} and @code{fr_offset}, and @code{fr_subtype} indicates theparticular machine-specific addressing mode desired.  @xref{Relaxation}.@item rs_orgThe start of the following frag should be pushed back to some specific offsetwithin the section.  (Some assemblers use the value as an absolute address; GASdoes not handle final absolute addresses, but rather requires that the linkerset them.)  The offset is given by @code{fr_symbol} and @code{fr_offset}; onecharacter from the variable-length tail is used as the fill character.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -