aboutsummaryrefslogtreecommitdiff
path: root/gas/read.c
AgeCommit message (Collapse)AuthorFilesLines
1996-10-01 * read.c (s_macro): Warn if a macro has the same name as aIan Lance Taylor1-10/+101
pseudo-op. (s_space): In m68k MRI mode, align to a word boundary. * macro.c (define_macro): Add namep parameter. Change all callers. * macro.h (define_macro): Update declaration.
1996-05-30 * read.c (s_lcomm): Set section flags for .sbss section.Ian Lance Taylor1-0/+5
1996-05-23Add .skip as a synonym for .spaceMichael Meissner1-61/+82
1996-03-29 * read.h (enum linkonce_type): Define.Ian Lance Taylor1-0/+78
(s_linkonce): Declare. * read.c (potable): Add "linkonce". (s_linkonce): New function. * subsegs.h (segment_info_type): Add linkonce field to MANY_SEGMENTS && ! BFD_ASSEMBLER section. * config/obj-coff.h (obj_handle_link_once): Define if TE_PE. (obj_coff_pe_handle_link_once): Declare if TE_PE. * config/obj-coff.c: If TE_PE and not BFD_ASSEMBLER, #include "coff/pe.h". (obj_coff_pe_handle_link_once): New function, defined if TE_PE. (c_section_symbol): If TE_PE, set the x_comdat field in the aux entry based on the linkonce field in segment_info. * doc/as.texinfo: Document .linkonce.
1996-03-22 * as.h (strdup): Don't declare.Ian Lance Taylor1-14/+10
* stabs.c: Include libiberty.h (get_stab_string_offset): Use xstrdup rather than strdup. (s_stab_generic): Likewise. * as.c (parse_args): Likewise. * read.c (s_mri_sect): Likewise.
1996-02-13 * read.c (potable): Add "mri" and ".mri".Ian Lance Taylor1-0/+33
(s_mri): New function. * read.h (s_mri): Declare. * app.c (scrub_m68k_mri): New static variable. (mri_pseudo): New static variable. (do_scrub_begin): Add m68k_mri parameter. Use it rather than flag_m68k_mri. Initialize scrub_m68k_mri. (mri_state, mri_last_ch): New static variables. (struct app_save): Add scrub_m68k_mri, mri_state, and mri_last_ch fields. (app_push): Save new fields. (app_pop): Restore new fields. (do_scrub_chars): Check scrub_m68k_mri rather than flag_mri_mri. If TC_M68K, use a trivial state machine to look for occurrences of the .mri pseudo-op, and change the mode appropriately. * as.h (do_scrub_begin): Update prototype. * input-scrub.c (input_scrub_begin): Pass flag_m68k_mri to do_scrub_begin. * config/tc-m68k.c (reg_prefix_optional_seen): New static variable. (m68k_mri_mode_change): New function. (md_parse_option): Set reg_prefix_optional_seen. * config/tc-m68k.h (m68k_mri_mode_change): Declare. (MRI_MODE_CHANGE): Define. * doc/as.texinfo: Document .mri pseudo-op.
1996-02-09 * read.c (potable): Pass negative numbers for new .balign[wl] andIan Lance Taylor1-21/+32
.p2align[wl] pseudo-ops. (s_align_bytes): Treat a negative argument as specifying the fill length. (s_align_ptwo): Likewise.
1996-02-08 * read.c (potable): Add balignw, balignl, p2alignw, and p2alignl.Ian Lance Taylor1-14/+68
(do_align): Take new len parameter. Change all callers. Pass it to md_do_align. (s_align_bytes): Arg now indicates the length of the fill pattern. (s_align_ptwo): Likewise. * config/obj-coff.c (write_object_file): Pass length to md_do_align. * config/tc-i386.h (md_do_align): Take new len parameter. * config/tc-m88k.h (md_do_align): Likewise. * config/tc-m88k.c (m88k_do_align): Likewise. * config/tc-sh.h (md_do_align): Likewise. * config/tc-sh.c (sh_do_align): Likewise. * doc/as.texinfo: Document new pseudo-ops. * config/obj-coff.c (fixup_mdeps): Divide offset by fr_var, as is done in cvt_frag_to_fill. PR 8974.
1996-02-07 * as.c (main): Call parse_args before read_begin.Ian Lance Taylor1-19/+31
* app.c (do_scrub_chars): If flag_m68k_mri, don't put a dot in front of generated pseudo-ops. * read.c (potable): Ignore "name". (s_app_file): Permit a single quote after the string, since one may appear in m68k MRI mode.
1995-12-05* read.c (s_fill): If md_flush_pending_output is defined, call it.Ken Raeburn1-0/+3
1995-11-28Clean up hash code, parameterize some actions, tweak some parameters. HashKen Raeburn1-30/+28
table entries, table allocation and control structure are larger now, but collisions are reduced and string compares even further reduced. Dump lots more statistics, especially hash code data, for --statistics. Dump statistics even in error cases. Details in ChangeLog.
1995-10-03 * cond.c (s_endif): Call demand_empty_rest_of_line. In MRI mode,Ian Lance Taylor1-11/+182
skip characters after the pseudo-op. (s_else): Likewise. * read.c (get_line_sb): Don't look past buffer_limit. (s_include): In MRI mode, skip characters after the file name.
1995-09-27 * config/tc-ppc.h (OBJ_XCOFF): Define if OBJ_COFF and not TE_PE.Ian Lance Taylor1-76/+140
Change OBJ_COFF checks to check OBJ_XCOFF instead. (TARGET_FORMAT): Fully parenthesize. (LEX_QM): Define if TE_PE. * config/tc-ppc.c: Replace OBJ_COFF by OBJ_XCOFF throughout. Remove checks of TE_PE within #ifdef OBJ_XCOFF sections. (init_regtable): Make i unsigned. (ppc_set_current_section): Rename from setCurrentSection. Change all callers. (ppc_arch): Return after as_fatal to avoid gcc warning. (md_assemble): Only declare reloc if OBJ_ELF. Add default to switch on fixups[i].reloc to avoid gcc warning. (IMAGE_SGN_LNK_OTHER): Fix nested comment. (ppc_pe_function): Don't call ppc_canonicalize_symbol_name. (ppc_frob_symbol): Remove TE_PE section checks. (md_estimate_size_before_relax): Return after abort to avoid gcc warning. (md_apply_fix3): Add BFD_RELOC_16_GOT_PCREL to switch. * read.c (LEX_QM): Define as 0 if not defined. (lex_type): Use LEX_QM for '?'.
1995-09-07 * expr.c (operand): Handle 08 and 09 in MRI mode.Ian Lance Taylor1-6/+38
* macro.c (ISSEP): Remove duplicated `"' character. (get_any_string): Copy some characters for which ISSEP is true: ';', '>', '(', ')'. Otherwise we can get in an infinite loop. * read.c (s_space): In MRI mode, the expressions stop at the first unquoted space. (cons_worker): In MRI mode, restore the terminating character at the end of the function.
1995-09-07 * read.c (cons_worker): Don't use #elif; old compilers don'tIan Lance Taylor1-1/+3
support it.
1995-09-07 * app.c (do_scrub_chars): In MRI mode, silently end quoted stringsIan Lance Taylor1-28/+144
at newline characters. In MRI mode, always keep spaces in the operands field. In MRI mode, treat a line comment character as a regular comment character following a space. * cond.c (ignore_input): Use strncasecmp rather than strncmp when looking for special pseudo-ops. * read.c (cons_worker): In MRI mode, the expressions stop at the first unquoted space. (equals): Likewise.
1995-08-21 * read.c (read_a_source_file): In MRI mode, don't end theIan Lance Taylor1-2/+8
statement inside a quotation. (s_space): Don't warn about a zero repeat count in MRI mode. * config/tc-m68k.c (crack_operand): In MRI mode, don't count parentheses inside quotes. (md_assemble): In MRI mode, anything after the operands field is a comment. (parse_mri_control_operand): Adjust start and stop to remove spaces. (s_mri_for): Likewise.
1995-08-21 Add support for macros.Ian Lance Taylor1-32/+226
* as.c: Include sb.h and macro.h. (max_macro_next): New global variable. (main): Call macro_init. (macro_expr): New static function. * as.h (max_macro_nest): Declare. * read.c (line_label): Rename from mri_line_label. Change all uses. (potable): Add exitm, irp, irpc, macro, mexit, rept. (read_a_source_file): Always clear line_label at the start of a line, not just when flag_mri or LABELS_WITHOUT_COLONS. Fixup MRI/LABELS_WITHOUT_COLONS handling. In MRI mode, permit label: equ val. Set line_label when calling colon. In MRI mode, a leading '.' does not imply a pseudo-op. Check for macro expansion before calling md_assemble. (s_irp): New function. (get_line_sb): New static function. (s_macro): New function. (s_mexit): New function. (s_rept): New function. * read.h (line_label): Rename from mri_line_label. (s_irp, s_rept): Declare. (s_macro, s_mexit): Declare. * input-scrub.c: Include sb.h. (sb_index, from_sb): New static variables. (macro_nest): New static variable. (struct input_save): Add sb_index and from_sb fields. Change next_saved_file field to be struct input_save *. (next_saved_file): Changed to be struct input_save *. (input_scrub_push): Change to return type struct input_save *. Save sb_index and from_sb. (input_scrub_pop): Change parameter type to struct input_save *. Restore sb_index and from_sb. (input_scrub_include_sb): New function. (input_scrub_next_buffer): Handle reading from from_sb. (bump_line_counters): Only increment lines if not using from_sb. * config/tc-m68k.c (opt_table): Add nest. (opt_nest): New static function. * gasp.c: Include sb.h and macro.h. Move all sb related functions and definitions to sb.h and sb.c. Move all macro related functions and definitions to macro.h and macro.c. * sb.h, sb.c: New files, extracted from gasp.c. * macro.h, macro.c: Likewise. * Makefile.in (OBJS): Add sb.o and macro.o (GASPOBJS): Define. (gasp.new): Depend upon $(GASPOBJS). Use $(GASPOBJS) to link. (TARG_CPU_DEP_m68k): Depend upon subsegs.h. (gasp.o): Depend upon sb.h and macro.h. (sb.o): New target. (macro.o): New target. (as.o): Depend upon sb.h and macro.h. (input-scrub.o): Depend upon sb.h. (read.o): Depend upon sb.h and macro.h.
1995-08-18 * read.c (s_include): In MRI mode, don't expect quotes around theIan Lance Taylor1-5/+21
file name. * listing.c (listing_title): Don't require the title to be quoted.
1995-08-10 * read.c (potable): Add spc, ttl, xcom, xref.Ian Lance Taylor1-0/+92
(s_mri_sect): New function. * read.h (s_mri_sect): Declare. * config/obj-coff.c (obj_coff_section) (both versions): In MRI mode, call s_mri_sect. (obj_pseudo_table): Add sect.s and section.s. Move sect outside of ifndef BFD_ASSEMBLER. * config/obj-elf.c (elf_pseudo_table): Add section.s, sect, sect.s. (obj_elf_section): In MRI mode, call s_mri_sect. * config/tc-m68k.c (md_pseudo_table): Add restore, save. (struct save_opts): Define. (save_stack): New static variable. (s_save, s_restore): New static functions.
1995-08-10 * read.c (s_set): Remove unused local ptr.Ian Lance Taylor1-4/+11
(hex_float): Check target_big_endian. (equals): Remove unused local p. * config/tc-a29k.h (TARGET_BYTES_BIG_ENDIAN): Define. * config/tc-h8500.h (TARGET_BYTES_BIG_ENDIAN): Define. * config/tc-hppa.h (TARGET_BYTES_BIG_ENDIAN): Define. * config/tc-i860.h (TARGET_BYTES_BIG_ENDIAN): Define. * config/tc-m68k.h (TARGET_BYTES_BIG_ENDIAN): Define. * config/tc-m88k.h (TARGET_BYTES_BIG_ENDIAN): Define. * config/tc-tahoe.h (TARGET_BYTES_BIG_ENDIAN): Define. * config/tc-sh.c (little): Set target_big_endian. (md_begin): Likewise. (md_parse_option): Likewise. (build_relax): Check target_big_endian rather than shl. (build_Mytes, md_atof): Likewise. (md_convert_frag, md_apply_fix): Likewise. (md_number_to_chars): Likewise.
1995-08-09 * read.c (mri_line_label): Make non-static.Ian Lance Taylor1-1/+14
(potable): Add nopage, page, plen. (s_org): Error if in MRI mode. * read.h (mri_line_label): Declare. * listing.c (listing_nopage): New function. * listing.h (listing_nopage): Declare.
1995-08-09 * read.c (abs_section_offset): New global variable.Ian Lance Taylor1-107/+314
(potable): Add offset, struct. (do_org): New static function; handle changing the origin in the absolute section. (s_org): Use do_org. (s_set): Likewise. (equals): Likewise. (s_space): In absolute_section, just increase abs_section_offset. (s_struct): New function. (emit_expr): Handle absolute_section specially. * read.h (abs_section_offset): Declare. (s_struct): Declare. * read.c (potable): Add ifeq, ifge, ifgt, ifle, iflt, ifne. Change if to pass O_ne to s_if. (read_a_source_file): Don't define an label without a colon if ignore_input returns true. * read.c (potable): Add dcb, dcb.b, dcb.d, dcb.l, dcb.s, dcb.w, dcb.x, ds.d, ds.p, ds.s, ds.x, elsec, endc, fail, format, llen, noformat. (read_a_source_file): If pseudo-op handler is s_end, quit immediately. (s_end): New function. (s_fail): New function. (s_float_space): New function. (hex_float): New static function. (float_cons): Use hex_float. * read.h (s_fail): Declare. (s_float_space): Declare.
1995-08-09 * configure.in: Move random special target handling beforeIan Lance Taylor1-0/+36
possible break. * configure: Rebuild.
1995-08-08 * struc-symbol.h (struct symbol): Add sy_mri_common bit.Ian Lance Taylor1-47/+297
* read.h (mri_comon_symbol): Declare. (s_mri_common): Declare. * read.c (mri_line_label): New static variable. (mri_common_symbol): New global variable. (potable): Add "common" and "common.s". (read_a_source_file): In MRI mode, set mri_line_label for a label at the start of a line. (s_mri_common): New function. (s_space): Handle mri_common_symbol. * symbols.c (colon): Change return value from void to symbolS *, and return new symbol. If mri_common_symbol is set, attach the new symbol to it. (resolve_symbol_value): Handle an sy_mri_common symbol. * symbols.h (colon): Change return value in declaration. * subsegs.c (subseg_set_rest): Clear mri_common_symbol. (subseg_set (both versions)): Likewise. * frags.c (frag_more): Warn if mri_common_symbol is not NULL. * write.c (adjust_reloc_syms): Skip sy_mri_common symbols. (write_object_file): Discard sy_mri_common symbols. (fixup_segment): Change relocations against sy_mri_common symbols to be against the common symbol itself. * config/obj-coff.c (yank_symbols): Discard sy_mri_common symbols. (fixup_segment): Change relocations against sy_mri_common symbols to be against the common symbol itself. * config/obj-aout.c (obj_crawl_symbol_chain): Discard sy_mri_common symbols.
1995-07-07 * read.c (s_lcomm): For .lcomm 1, set align to 0, not 1.Ian Lance Taylor1-1/+1
PR 5167.
1995-07-07 * app.c (do_scrub_next_char): Always accept \v. Don't make itIan Lance Taylor1-2/+0
conditional on BACKSLASH_V. * read.c (next_char_of_string): Likewise. * config/obj-bout.h (BACKSLASH_V): Don't define. * config/tc-mips.h (BACKSLASH_V): Don't define. PR 5604.
1995-07-06fsf address updateKen Raeburn1-7/+30
1995-05-04* as.h (LOCAL_LABELS_DOLLAR, LOCAL_LABELS_FB): If not already defined, defineKen Raeburn1-9/+6
them to zero. * config/tc-*.h, config/te-*.h: If defining them, define them to be 1 instead of empty. * expr.c (integer_constant, operand): Test them at run time instead of compile time. * read.c (read_a_source_file): Ditto. * symbols.c (colon): Ditto. (dollar_*, define_dollar_label, fb_*): Define unconditionally. * symbols.h (dollar_*, define_dollar_label, fb_*): Declare unconditionally.
1995-05-02(pop_insert): New function.Ken Raeburn1-56/+46
(pop_override_ok, pop_table_name): New variables. (md_pop_insert, obj_pop_insert): New macros. (pobegin): Use them. (target_big_endian): If TARGET_BYTES_BIG_ENDIAN is defined, initialize to 1.
1995-04-26Support for more portable alignment handling in assembly code, based on patchesKen Raeburn1-10/+18
from Bryan Ford <baford@schirf.cs.utah.edu>: * read.c (potable): Added balign and p2align, for aligning by bytes or powers of two independent of what ".align" does for a given target. * doc/as.texinfo: Document them.
1994-12-31Handle .space directive with non-constant operand:Ken Raeburn1-19/+35
* read.c (s_space): Rewrite to handle general expressions. Generate rs_space frags for non-constant values. * write.c (cvt_frag_to_fill): Treat rs_align_code and rs_space like rs_align and rs_org. Verify that fr_offset is non-negative, and force frag type to rs_fill only after assertion checks. (relax_segment): Treat rs_align_code like rs_align. Treat rs_space like rs_org in the first switch; in the second, force the operand to a constant, and use it for the growth size.
1994-11-03Changes from net 2.5.2 release branch:Ken Raeburn1-1/+1
* configure.in: Put AC_DEFINE(sparcv9) on its own line, so that the shell variable settings associated with it are permanent. For CPUs requiring bfd_gas=yes, select it based on CPU only, not individual target names. Handle m68k-hp-hpux*, not just -hpux. * config/tc-z8k.c (tc_coff_symbol_emit_hook): Add dummy argument to match prototype in obj-coff.h. * configure.in: Skip tests for defining WANT_FOPEN_BIN and IBM_COMPILER_SUX. * acconfig.h: Deleted them. * configure, conf.in: Rebuild with autoconf 2.0. * config/go32.cfg, config/vms-conf.h: Updated. * config/tc-m68k.c (md_apply_fix_2, md_convert_frag_1): Always use IBM_COMPILER_SUX version of code, with comments indicating why. * listing.c (file_info): Use text mode when opening file for read. Use "r" directly, no macro. * input-file.c (input_file_open): Don't use FOPEN_RT, just use "r". * read.c (s_include): Ditto. * output-file.c (output_file_create): Try both "wb" and "w", don't bother with FOPEN_* macros. * as.h: Don't include fopen-*.h. * config/alpha-opcode.h: Make "ret" with no operands equivalent to "ret zero,(ra)", to match OSF1 and to be consistent with both one-operand forms. Patches from DJ Delorie: * as.h (alloca): undef alloca before defining it just in case * config/go32.cfg: new file for autoconf values * config/te-go32.h: new file * configure.bat: new for autoconf * config/tc-i386.c (md_assemble): Fix typo in GOTPC check; had = for ==. * configure.in: If target_frag doesn't exist, use /dev/null. * as.c (parse_args): For non-VMS systems, re-add `v' to std_shortopts. Add "verbose" to list of long options. * write.c (adjust_reloc_syms): When generating an absolute section symbol as a placeholder, don't mark it as used in a relocation entry, here. * Makefile.in (comparison): Compare using makefile code from gcc, stripped down to discard subdir stuff and adapted to give a non-zero exit status if either file differs.
1994-10-17 * read.c (read_a_source_file): The second argument to as_where isIan Lance Taylor1-4/+4
unsigned int *, not int *.
1994-09-21Combine two existing mechanisms for copying symbol attributes, and fix a bug:Ken Raeburn1-10/+3
* symbols.c (copy_symbol_attributes): New function. Copies BFD symbol flags and calls OBJ_COPY_SYMBOL_ATTRIBUTES. (resolve_symbol_value, case O_symbol): Call it, if X_add_number is zero. Don't call obj_frob_forward_symbol. * read.c (pseudo_set): Call copy_symbol_attributes, but only if X_add_number is zero. * config/obj-elf.h (obj_frob_forward_symbol): Deleted.
1994-09-19* read.c (pseudo_set, case O_symbol): If OBJ_COPY_SYMBOL_ATTRIBUTES is defined,Ken Raeburn1-3/+17
invoke it. [BFD_ASSEMBLER]: Copy BSF_FUNCTION setting too. * config/obj-elf.h (OBJ_COPY_SYMBOL_ATTRIBUTES): Define. Also minor VMS support from Pat Rankin.
1994-09-12 * read.c (read_a_source_file): The second argument to as_where isIan Lance Taylor1-2/+3
unsigned int *, not int *.
1994-09-09Modified Files:Kung Hsu1-4/+9
ChangeLog read.h read.c ecoff.h ecoff.c * read.h : ditto. * read.c (read_a_source_file): if no file when inst is read, set generate_asm_lineno to true. * ecoff.h : change name to generate_asm_lineno and add function ecoff_no_current_file. * ecoff.c : change name to generate_asm_lineno. * ecoff.c (ecoff_generate_asm_lineno) : new function, to generate ecoff style line for asm file.
1994-07-08Modified Files:Kung Hsu1-7/+16
read.c read.h ecoff.c ecoff.h ChangeLog * read.c (read_a_source_file): generate line stabs for asm file. * read.h: add extern generate_asm_line_stab. * ecoff.h : add prototype for ecoff_generate_asm_line_stab(). * ecoff.c (add_file): if there's no filename provided, set switch to generate line stabs for .s file. * ecoff.c (add_procedure): add stabs symbol for .ent directive. * ecoff.c (generate_ecoff_stab): creates an artificial stabs. * ecoff.c (generate_asm_line_stab): generate a artifitial label for each line and generate a stabn for the line.
1994-06-04 * read.c (emit_expr): Use memset to zero out memory, rather thanIan Lance Taylor1-1/+1
going through md_number_to_chars. This permits handling symbolic arguments when the size is larger than sizeof (valueT), if TC_CONS_FIX_NEW is prepared to handle the case (as it is on MIPS).
1994-06-03 * as.h: Replace flagseen with separate variables.David MacKenzie1-3/+6
* as.c (parse_args): Set them. Don't accept -1 option, or -v explicitly (it's a synonym for --version). * as.c, input-scrub.c, messages.c, read.c, symbols.c, write.c, config/obj-aout.c, config/obj-aout.h, config/obj-bout.c, config/obj-bout.h, config/obj-coff.c, config/obj-coff.h, config/obj-vms.c, config/tc-hppa.c, config/tc-i386.c, config/tc-i960.c, config/tc-m68k.c, config/tc-mips.c, config/tc-vax.c: Use the new flag variables instead of flagseen. * config/tc-vax.c [OBJ_VMS]: Recognize -+, -1, -v, and document in usage.
1994-06-02(potable): Add this_gcc_requires_the_gnu_assembler in all lower-case, in caseKen Raeburn1-8/+25
we're ignoring case of opcodes in the input file.
1994-02-22 * read.c (s_lcomm): Use an alignment power of 3 for 8 byte .lcommIan Lance Taylor1-1/+3
variables.
1994-02-21 * read.c (read_a_source_file): Use correct arguments to memcpyIan Lance Taylor1-1/+1
(broken 19 Jul 1993). From kjd@pescadero.stanford.edu (Kenneth Duda).
1994-02-10 * read.c (do_align): Don't define label just_record_alignmentIan Lance Taylor1-0/+4
unless it might be used.
1994-02-09 * app.c (do_scrub_next_char): If NO_STRING_ESCAPES is defined,Ian Lance Taylor1-3/+11
don't treat backslash specially inside strings. * read.c (next_char_of_string): Likewise.
1994-01-31 * read.c (s_lcomm): Align lcomm data.Steve Chamberlain1-0/+12
* config/tc-z8k.c (tc_reloc_mangle): Don't allow subtraction from different sections.
1994-01-30* read.c (do_align): New function, most of guts of s_align_* functions. LookKen Raeburn1-27/+56
for md_do_align macro, give it a chance to bypass all but recording of section alignment. (s_align_bytes, s_align_ptwo): Call do_align. (s_lcomm) [TC_ALPHA]: Align object to largest power of two that divides object size.
1994-01-27 * read.c (lex_type): No longer make '{' a valid character forIan Lance Taylor1-1/+1
symbol names.
1994-01-24read.c (s_lcomm): Treat Alpha like MIPS in handling of .sbss section.Ken Raeburn1-2/+2