aboutsummaryrefslogtreecommitdiff
path: root/gas/read.c
AgeCommit message (Collapse)AuthorFilesLines
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
1994-01-15* read.c (emit_expr): Fix computation of mask.David Edelsohn1-2/+2
1994-01-12* expr.c (integer_constant): Fix computation of too_many_digits. VariableDavid Edelsohn1-7/+7
digit_2 renamed to start. Fix check for whether number will fit in 32 bits. * read.c (emit_expr): Use valueT instead of long.
1993-12-15removed an unnecessary commentKen Raeburn1-2/+2
1993-11-28Fix typo in last change.Jeff Law1-1/+1
1993-11-28 * read.c (read_a_source_file): Fix test for when to stick a colonJeff Law1-366/+6
on the end of a label. Make code conditional on either MRI or LABELS_WITHOUT_COLONS. * app.c (do_scrub_next_char): If a line begins with whitespace, leave the single whitespace character alone. Eat all others. * config/tc-hppa.h (LABELS_WITHOUT_COLONS): Define.
1993-11-17 * read.c (read_a_source_file): If we find a bad pseudo-op,Ian Lance Taylor1-16/+14
do a continue to go on to the next line rather than a break. Removed duplicate bad pseudo-op code which was never executed. * read.c (s_lcomm): Do not require a comma after the name. * read.c (s_lcomm): Set bss flag for .sbss section if used.
1993-11-02 * read.c (s_lcomm): Put small objects in .sbss for MIPS ELF asIan Lance Taylor1-3/+2
well as MIPS ECOFF. (get_stab_string_offset): Remove unused variable aligned.
1993-11-02Fix tipo in comment.Ian Lance Taylor1-1/+1
1993-10-31 * read.c (get_stab_string_offset): Set SEC_DEBUGGING for anyJeff Law1-2/+3
stab section we make. (s_stab_generic): Likewise.
1993-10-31 * expr.c (make_expr_symbol): Delete DOT_LABEL_PREFIX codeJeff Law1-32/+74
and instead simply use the string defined by FAKE_LABEL_NAME. (operand): Likewise. * read.c (s_stab_generic): Likewise.
1993-10-06 Changes to let cons handle bignums like general expressions.Ian Lance Taylor1-449/+303
* expr.h (expressionS): New field X_unsigned. * expr.c (operand): Initialize X_unsigned to 1. Set it to 0 for unary minus case. (expr) Fix typo resultP to right if missing operand. Set X_unsigned to 1 when building new expression. * read.c (potable): Make "octa" and "quad" call cons, not big_cons. (cons): Handle bignums. If given an O_constant (small integer) to fill a big space, turn it into a bignum. (parse_bitfield_cons): Set X_unsigned field. (bignum_low, bignum_limit, bignum_high, grow_bignum, big_cons): Removed. * read.h (big_cons): Remove prototype. * symbols.c (resolve_symbol_value): Don't give a warning if a symbol in expr_section can not be resolved. (S_SET_VALUE): Clear X_unsigned. * write.c (write_object_file): If resolve_symbol_value failed on a symbol we are writing out, give a warning. * config/tc-h8500.c (parse_reglist): Set X_unsigned. * config/tc-hppa.c (md_pseudo_table): Change "octa" and "quad" to call pa_cons, not pa_big_cons. (pa_big_cons): Remove. * config/tc-hppa.h (pa_big_cons): Remove declaration. * config/tc-i960.c (md_pseudo_table): Change "quad" to call cons, not big_cons.
1993-09-13 * subsegs.c: Renamed non-BFD_ASSEMBLER subseg_new to subseg_set.Ian Lance Taylor1-91/+64
Wrote non-BFD_ASSEMBLER subseg_new. Now subseg_new always takes a section name, and subseg_set always takes a segT. Changed all callers as appropriate. * config/obj-coffbfd.c (change_to_section): Renamed to obj_coff_add_segment. Corrected. Made callers use subseg_new. * config/obj-coffbfd.h (obj_segment_name, obj_add_segment): Define. Also some more gcc warning removal.
1993-09-10gcc lint. See ChangeLog for details. Also:Ian Lance Taylor1-40/+50
* config/obj-elf.h (S_SET_SIZE): Actually set the size.
1993-09-09 * read.c (get_stab_string_offset, s_stab_generic): IfIan Lance Taylor1-4/+8
BFD_ASSEMBLER, call subseg_set rather than subseg_new.
1993-09-08Add missing ifdef to make m68k-aout targets happy.Stan Shebs1-0/+2
1993-09-07Changes to support stabs-in-coffStan Shebs1-6/+450
1993-08-18(potable): Treat "string" like "asciz".Ken Raeburn1-7/+8
1993-08-05(emit_expr): Use BFD_RELOC_64 fr 8-byte expressions.Ken Raeburn1-6/+14
1993-07-23 * read.c (read_a_source_file): In NO_PSEUDO_DOT case, if we find aIan Lance Taylor1-0/+2
pseudo-op with a poc_handler field of NULL, ignore it and treat it as an instruction instead. * config/tc-m88k.c (md_pseudo_table): Add "set" with a NULL poc_handler field.
1993-07-21 * read.c (read_a_source_file): If NO_PSEUDO_DOT is defined, lookIan Lance Taylor1-3/+12
up opcodes as pseudo-ops even if they don't start with '.'. * config/tc-m88k.h (NO_PSEUDO_DOT): Define. * config/tc-m88k.c (md_assemble): Removed special pseudo-op handling. (md_apply_fix): Set fx_offset to the upper 16 bits of the reloc. Output the low 16 bits for RELOC_HI16, not the high 16 bits. * config/obj-coffbfd.c (do_relocs_for): If TC_M88K, set the r_offset field of the reloc to the fixup offset. (fixup_segments): If TC_M88K, don't warn about fixup overflows. * doc/as.texinfo: Minor updates.
1993-07-21 * Extensive changes to permit symbols to contain any expressionIan Lance Taylor1-204/+121
type and to delay the computation of the expression until the value is actually needed. This permits setting symbols to values calculated based on object code size. Expressions were changed to no longer be in a section, to stop the overloading of segment and expression type that previously occurred. * as.c (big_section, pass1_section, diff_section, absent_section): Removed. (expr_section): Added (used for dummy symbols which hold intermediate expression values). (perform_an_assembly_pass): Create expr_section, do not create the sections now removed. * as.h (segT): Removed SEG_ABSENT, SEG_PASS1, SEG_BIG, and SEG_DIFFERENCE. Added SEG_EXPR. (SEG_NORMAL): Corresponding changes. * subsegs.c (seg_name, subsegs_begin): Changed accordingly. * write.c (write_object_file): Ditto. * config/obj-aout.c (seg_N_TYPE): Ditto. * config/obj-bout.c (seg_N_TYPE): Ditto. * config/obj-coff.c (seg_N_TYPE): Ditto. * config/obj-coffbfd.c (seg_N_TYPE): Ditto. * config/obj-vms.c (seg_N_TYPE): Ditto. * expr.h (operatorT): Moved in from expr.c, added some values. (expressionS): Added X_op field, removed X_seg field; renamed X_subtract_symbol to X_op_symbol. * expr.c: Extensive changes to assign expression types rather than sections and to simplify the parsing. * write.c (fix_new_internal): New static function. (fix_new): Removed sub_symbol argument. (fix_new_exp): New function, takes expression argument. * write.h: Prototype changes for fix_new and fix_new_exp. * cond.c (s_if): Changed accordingly. * read.c (s_lsym, pseudo_set, emit_expr, parse_bitfield_cons, parse_repeat_cons, get_segmented_expression, get_known_segmented_expression, get_absolute_expression): Ditto. * symbols.c (resolve_symbol_value, S_GET_VALUE, S_SET_VALUE): Ditto. * write.c (write_object_file): Ditto. * config/obj-coff.c (obj_coff_def, obj_coff_val): Ditto. * config/obj-coffbfd.c (obj_coff_def, obj_coff_val, obj_coff_endef, yank_symbols): Ditto. * config/obj-elf.c (obj_elf_stab_generic, obj_elf_size): Ditto. * config/tc-a29k.c (md_assemble, parse_operand, machine_ip, print_insn, md_operand): Ditto. * config/tc-h8300.c (parse_exp, colonmod24, check_operand, do_a_fix_imm, build_bytes): Ditto. * config/tc-h8500.c (parse_exp, skip_colonthing, parse_reglist, get_specific, check, insert, md_convert_frag): Ditto. * config/tc-hppa.c (the_insn, fix_new_hppa, cons_fix_new_hppa, md_assemble, pa_ip, getExpression, getAbsoluteExpression, evaluateAbsolute, pa_build_unwind_subspace, pa_entry, process_exit): Ditto. * config/tc-hppa.h (STAB_FIXUP, is_DP_relative, is_PC_relative, is_complex): Ditto. * config/tc-i386.c (pe, md_assemble, i386_operand, md_estimate_size_before_relax, md_create_long_jump): Ditto. * config/tc-i860.c (md_assemble, getExpression, print_insn): Ditto. * config/tc-i960.c (parse_expr, subs, segs, md_convert_frag, get_cdisp, mem_fmt, parse_ldconst, relax_cobr, s_sysproc, i960_handle_align): Ditto. * config/tc-m68k.c (struct m68k_exp, struct m68k_it, seg, op, subs, add_fix, isvar, m68k_ip, md_assemble, md_convert_frag_1, md_estimate_size_before_relax, md_create_long_jump, get_num): Ditto. * config/tc-m88k.c (md_assemble, get_imm16, get_pcr, md_create_short_jump, md_create_long_jump): Ditto. * config/tc-mips.c (md_assemble, append_insn, gp_reference, macro_build, macro, my_getExpression): Ditto. Also removed get_optional_absolute_expression; just use get_absolute_expression instead. * config/tc-ns32k.c (get_addr_mode, evaluate_expr, convert_iif, fix_new_ns32k, fix_new_ns32k_exp, cons_fix_new_ns32k): Ditto. * config/tc-ns32k.h (fix_new_ns32k prototype): Ditto. * config/tc-sh.c (parse_exp, check, insert, md_convert_frag): Ditto. * config/tc-sparc.c (md_assemble, sparc_ip, getExpression, print_insn): Ditto. * config/tc-tahoe.c (struct top, md_estimate_size_before_relax, tip_op, md_assemble): Ditto. * config/tc-vax.c (seg_of_operand, md_assemble, md_estimate_size_before_relax, md_create_long_jump): Ditto. * config/tc-z8k.c (parse_exp, check_operand, newfix): Ditto.
1993-07-19(read_begin): Call obstack_begin with values closer to 1K multiples.Ken Raeburn1-6/+8
(read_a_source_file, big_cons, float_cons): Use memcpy instead of bcopy.
1993-07-19 * expr.c (clean_up_expression): Don't cancel the subtraction ofIan Lance Taylor1-2/+11
undefined symbols. Fixes PR 2997. * read.c (s_data), config/obj-coffbfd.c (obj_coff_data): If -R, switch to text section rather than data section. Fixes PR 2971.
1993-07-16 * read.c (float_cons): Simplified parsing logic. IfIan Lance Taylor1-24/+35
REPEAT_CONS_EXPRESSIONS is defined, accept a repeat count. * symbols.c (colon): Rather than a special case for TC_HPPA, use new macro tc_frob_label.
1993-07-15 * Preliminary support for m88k-coff.Ian Lance Taylor1-6/+7
* configure.in (m88k-*-coff*): New target. Use coffbfd and m88kcoff. * config/m88kcoff.mt: New file. * read.c (lex_type): New macro LEX_AT to set lex type of '@'. (pseudo_set): Handle difference of symbols in different fragments by saving the entire expression as the value of the symbol. * symbols.c (resolve_symbol_value): Resolve difference expressions. * config/obj-coffbfd.c (obj_pseudo_table): If TC_M88K, accept "sdef" as a synonym for "def". * config/obj-coffbfd.h: If TC_M88K, include coff/m88k.h and set TARGET_FORMAT. (S_IS_LOCAL): Any symbol which includes \001 in the name is local. * config/tc-m88k.c, config/tc-m88k.h: Numerous changes to bring m88k port up to date, and to add COFF support.
1993-07-14 * Removed sy_forward and replaced it with an undefined expressionIan Lance Taylor1-2/+8
as the value of a symbol. * struc-symbol.h (struct symbol): Removed sy_forward field. Added sy_resolved and sy_resolving single bit fields. * symbols.c (symbol_new): Don't initialize sy_forward field. (resolve_symbol_value): New function to adjust symbol value by fragment address, using recursion to resolve forward symbols. * symbols.h: Added prototype for new function. * read.c (pseudo_set): Set symbolP->sy_value to an undefined expression rather than setting symbolP->sy_forward. * write.c (write_object_file): Use resolve_symbol_value on symbols, keeping the common case (the old behaviour) inline. * config/obj-aout.c (obj_aout_frob_symbol): Removed sy_forward handling (subsumed by write.c change). * config/obj-coff.c, config/obj-coffbfd.c (obj_coff_val): Set sy_value rather than sy_forward. * config/obj-coffbfd.c (obj_coff_endef, yank_symbols): Check expression segment rather than sy_forward. (yank_symbols): Use resolve_symbol_value. (crawl_symbols): Removed extra pass over symbols. * config/obj-aout.c, config/obj-bout.c, config/obj-coff.c, config/obj-vms.c (obj_crawl_symbol_chain): Removed extra pass over symbols which handled sy_forward; use resolve_symbol_value instead. * config/obj-coff.h, config/obj-coffbfd.h (obj_frob_forward_symbol): Define. * config/obj-elf.c (obj_elf_stab_generic): Check expression segment rather than sy_forward. * config/obj-vms.c (VMS_Check_For_Main): Don't initialize sy_forward; do initialize sy_resolved and sy_resolving. * config/tc-hppa.h (STAB_FIXUP): Use sy_value, not sy_forward.
1993-07-07(s_comm): Values read are type valueT.Ken Raeburn1-302/+385
1993-05-27read.c (s_align_bytes): Properly record alignment.Ken Raeburn1-0/+2
expr.c (__): Undefine before defining. as.c (got_sig): Don't return anything; return type might be void. Whitespace/comment cleanup in frags.c. Some patches for `-pedantic' or `-fno-common' compilation. (Some of these changes are from Michael Meissner; see change log.)
1993-05-27 * app.c (do_scrub_begin): Let line_comment_chars overrideIan Lance Taylor1-28/+86
comment_chars. (do_scrub_next_char): If a line comment character is not at the start of a line, treat it as a comment character if it is one. For a CPP line comment use pseudo-op .appline rather than .line. * input-scrub.c (logical_input_line): Make int rather than unsigned. (input_scrub_push, input_scrub_begin): Initialize logical_input_line to -1 rather than 0. (bump_line_counters): Increment logical_input_line. (new_logical_line): If line_number is -2, decrement logical_input_line. (as_where): Use logical_input_line even if it is 0. * read.h (s_app_file prototype): Now takes an int argument. * read.c (potable): Make .appfile call s_app_file with 1. New .appline pseudo-op calls s_app_line. (s_app_file): If .appfile, call new_logical_line with -2 to account for newline inserted by do_scrub_next_char. If listing, call listing_source_file. (s_app_line): New function to handle fake pseudo-op .appline. * config/obj-coff.c (obj_pseudo_table): Make .appline call obj_coff_ln. (obj_coff_ln): Added argument to indicate whether .appline. * config/obj-coffbfd.c (obj_pseudo_table): Make .appline call obj_coff_ln. (obj_coff_ln): Added argument to indicate whether .appline. * config/tc-mips.c (s_file): Pass argument to s_app_file.
1993-03-29(big_cons): If target_big_endian, reverse bytes being copied. (TemporaryKen Raeburn1-8/+16
fix -- should be cleaned up later.) (s_ignore): Delete declaration of is_end_of_line. (potable): Change .app-file to .appfile.
1993-03-04 * read.c (s_space): Multiply repeat count by mult, not fill.Steve Chamberlain1-1/+1