\input texinfo
-@c Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-@c 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
-@c Free Software Foundation, Inc.
+@c Copyright (C) 1991-2019 Free Software Foundation, Inc.
@setfilename internals.info
@node Top
@top Assembler Internals
@cindex symbolS structure
The definition for the symbol structure, @code{symbolS}, is located in
-@file{struc-symbol.h}.
+@file{symbols.c}.
-In general, the fields of this structure may not be referred to directly.
+The fields of this structure may not be referred to directly.
Instead, you must use one of the accessor functions defined in @file{symbol.h}.
-These accessor functions should work for any GAS version.
Symbol structures contain the following fields:
@cindex S_IS_EXTERNAL
Return non-zero if the symbol is externally visible.
-@item S_IS_EXTERN
-@cindex S_IS_EXTERN
-A synonym for @code{S_IS_EXTERNAL}. Don't use it.
-
@item S_IS_WEAK
@cindex S_IS_WEAK
Return non-zero if the symbol is weak, or if it is a @code{weakref} alias or
be determined upon use.
@item S_GET_TYPE
-@item S_GET_DESC
-@item S_GET_OTHER
+@itemx S_GET_DESC
+@itemx S_GET_OTHER
@cindex S_GET_TYPE
@cindex S_GET_DESC
@cindex S_GET_OTHER
a.out).
@item S_SET_TYPE
-@item S_SET_DESC
-@item S_SET_OTHER
+@itemx S_SET_DESC
+@itemx S_SET_OTHER
@cindex S_SET_TYPE
@cindex S_SET_DESC
@cindex S_SET_OTHER
@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 BFD
-symbol. The first field of @code{struct local_symbol} is a pointer which is
-always set to NULL. This is how the symbol accessor functions can distinguish
-local symbols from ordinary symbols. The symbol accessor functions
-automatically convert a local symbol into an ordinary symbol when necessary.
-
@node Expressions
@subsection Expressions
@cindex internals, expressions
@cindex porting
Each GAS target specifies two main things: the CPU file and the object format
-file. Two main switches in the @file{configure.in} file handle this. The
+file. Two main switches in the @file{configure.ac} file handle this. The
first switches on CPU type to set the shell variable @code{cpu_type}. The
second switches on the entire target to set the shell variable @code{fmt}.
@item tc_comment_chars
@cindex tc_comment_chars
If this macro is defined, GAS will use it instead of @code{comment_chars}.
+This has the advantage that this macro does not have to refer to a constant
+array.
@item tc_symbol_chars
@cindex tc_symbol_chars
if found in a comment, such as after a character in line_comment_chars or
comment_chars.
+@item tc_line_separator_chars
+@cindex tc_line_separator_chars
+If this macro is defined, GAS will use it instead of
+@code{line_separator_chars}. This has the advantage that this macro does not
+have to refer to a constant array.
+
+
@item EXP_CHARS
@cindex EXP_CHARS
This is a null terminated @code{const char} array of characters which may be
pseudo-op such as @code{.word}. You can use this to recognize relocation
directives that may appear in such directives.
-@item BITFIELD_CONS_EXPRESSION
-@cindex BITFIELD_CONS_EXPRESSION
-If you define this macro, GAS will recognize bitfield instructions in data
-allocation pseudo-ops, as used on the i960.
-
@item REPEAT_CONS_EXPRESSION
@cindex REPEAT_CONS_EXPRESSION
If you define this macro, GAS will recognize repeat counts in data allocation
A C statement to output target specific debugging information for
fixup @var{fixp} to @var{stream}. This macro is called by @code{print_fixup}.
-@item TC_FRAG_INIT (@var{fragp})
+@item TC_FRAG_INIT (@var{fragp}, @var{max_bytes})
@cindex TC_FRAG_INIT
-A C statement to initialize the target specific fields of frag @var{fragp}.
-These fields are defined with the @code{TC_FRAG_TYPE} macro.
+A C statement to initialize the target specific fields of frag @var{fragp}
+with maximum number of bytes @var{max_bytes}. These fields are defined
+with the @code{TC_FRAG_TYPE} macro.
@item md_number_to_chars
@cindex md_number_to_chars
@item LINKER_RELAXING_SHRINKS_ONLY
@cindex LINKER_RELAXING_SHRINKS_ONLY
If you define this macro, and the global variable @samp{linkrelax} is set
-(because of a command line option, or unconditionally in @code{md_begin}), a
+(because of a command-line option, or unconditionally in @code{md_begin}), a
@samp{.align} directive will cause extra space to be allocated. The linker can
then discard this space when relaxing the section.
@cindex TC_FINALIZE_SYMS_BEFORE_SIZE_SEG
Specifies the value to be assigned to @code{finalize_syms} before the function
@code{size_segs} is called. Since @code{size_segs} calls @code{cvt_frag_to_fill}
-which can call @code{md_convert_frag}, this constant governs whether the symbols
+which can call @code{md_convert_frag}, this constant governs whether the symbols
accessed in @code{md_convert_frag} will be fully resolved. In particular it
governs whether local symbols will have been resolved, and had their frag
information removed. Depending upon the processing performed by
difference of two symbols in the same section. If this macro returns zero,
the subtrahend will be resolved and @code{fx_subsy} set to @code{NULL} for
@code{md_apply_fix}. If undefined, the default of
-@w{@code{! SEG_NORMAL (@var{seg}) || TC_FORCE_RELOCATION (@var{fix})}} will
-be used.
+@w{@code{! SEG_NORMAL (@var{seg})}} will be used.
@item TC_FORCE_RELOCATION_SUB_ABS (@var{fix}, @var{seg})
@cindex TC_FORCE_RELOCATION_SUB_ABS
@cindex tc_frob_label
If you define this macro, GAS will call it each time a label is defined.
+@item tc_new_dot_label
+@cindex tc_new_dot_label
+If you define this macro, GAS will call it each time a fake label is created
+off the special dot symbol.
+
@item md_section_align
@cindex md_section_align
GAS will call this function for each section at the end of the assembly, to
If you define this macro, GAS will call it after the relocs have been
generated.
+@item tc_cfi_reloc_for_encoding
+@cindex tc_cfi_reloc_for_encoding
+This macro is used to indicate whether a cfi encoding requires a relocation.
+It should return the required relocation type. Defining this macro implies
+that Compact EH is supported.
+
@item md_post_relax_hook
If you define this macro, GAS will call it after relaxing and sizing the
segments.
@item obj_begin
If you define this macro, GAS will call it at the start of the assembly, after
-the command line arguments have been parsed and all the machine independent
+the command-line arguments have been parsed and all the machine independent
initializations have been completed.
@item obj_app_file
while still preserving intra-section references and meeting alignment
requirements.
-For the i960 using b.out format, no expansion is done; instead, each
-@samp{.align} directive causes extra space to be allocated, enough that when
-the linker is relaxing a section and removing unneeded space, it can discard
-some or all of this extra padding and cause the following data to be correctly
-aligned.
-
For the H8/300, I think the linker expands calls that can't reach, and doesn't
worry about alignment issues; the cpu probably never needs any significant
alignment beyond the instruction size.