Commit Graph

78 Commits

Author SHA1 Message Date
Ian Lance Taylor
ca2329727e * read.c (s_include): In MRI mode, don't expect quotes around the
file name.
	* listing.c (listing_title): Don't require the title to be quoted.
1995-08-18 15:15:28 +00:00
Ian Lance Taylor
e14994d980 * read.c (potable): Add spc, ttl, xcom, xref.
(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 16:19:34 +00:00
Ian Lance Taylor
a920b69312 * read.c (s_set): Remove unused local ptr.
(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-10 04:44:59 +00:00
Ian Lance Taylor
69e077f3c7 * read.c (mri_line_label): Make non-static.
(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 23:16:06 +00:00
Ian Lance Taylor
e28c40d725 * read.c (abs_section_offset): New global variable.
(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 19:36:25 +00:00
Ian Lance Taylor
286cb27aac * configure.in: Move random special target handling before
possible break.
	* configure: Rebuild.
1995-08-09 14:53:21 +00:00
Ian Lance Taylor
1356d77df3 * struc-symbol.h (struct symbol): Add sy_mri_common bit.
* 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-08-08 21:41:30 +00:00
Ian Lance Taylor
c71a604ae1 * read.c (s_lcomm): For .lcomm 1, set align to 0, not 1.
PR 5167.
1995-07-07 22:42:13 +00:00
Ian Lance Taylor
6be977fb57 * app.c (do_scrub_next_char): Always accept \v. Don't make it
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-07 20:10:27 +00:00
Ken Raeburn
a2a5a4fa41 fsf address update 1995-07-06 21:18:08 +00:00
Ken Raeburn
9777b772c8 * as.h (LOCAL_LABELS_DOLLAR, LOCAL_LABELS_FB): If not already defined, define
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-04 01:56:40 +00:00
Ken Raeburn
2209b19c4e (pop_insert): New function.
(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-05-02 19:30:17 +00:00
Ken Raeburn
931a8fab1b Support for more portable alignment handling in assembly code, based on patches
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.
1995-04-26 20:02:18 +00:00
Ken Raeburn
cd3b81bd4c Handle .space directive with non-constant operand:
* 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-12-31 00:08:40 +00:00
Ken Raeburn
f28891108c Changes from net 2.5.2 release branch:
* 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-11-03 23:15:54 +00:00
Ian Lance Taylor
f10a96cbec * read.c (read_a_source_file): The second argument to as_where is
unsigned int *, not int *.
1994-10-17 22:07:16 +00:00
Ken Raeburn
ef19887066 Combine two existing mechanisms for copying symbol attributes, and fix a bug:
* 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-21 22:21:25 +00:00
Ken Raeburn
80d80c640a * read.c (pseudo_set, case O_symbol): If OBJ_COPY_SYMBOL_ATTRIBUTES is defined,
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-19 16:40:00 +00:00
Ian Lance Taylor
1b434ced73 * read.c (read_a_source_file): The second argument to as_where is
unsigned int *, not int *.
1994-09-12 21:52:43 +00:00
Kung Hsu
326d16cac7 Modified Files:
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-09-09 01:05:28 +00:00
Kung Hsu
daad3bbf95 Modified Files:
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-07-08 19:38:18 +00:00
Ian Lance Taylor
1fbfe10880 * read.c (emit_expr): Use memset to zero out memory, rather than
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-04 03:38:01 +00:00
David MacKenzie
def66e248c * as.h: Replace flagseen with separate variables.
* 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-03 20:59:20 +00:00
Ken Raeburn
6ef37255ad (potable): Add this_gcc_requires_the_gnu_assembler in all lower-case, in case
we're ignoring case of opcodes in the input file.
1994-06-02 16:15:56 +00:00
Ian Lance Taylor
9d90491e82 * read.c (s_lcomm): Use an alignment power of 3 for 8 byte .lcomm
variables.
1994-02-22 03:49:42 +00:00
Ian Lance Taylor
9eb5f4b8c6 * read.c (read_a_source_file): Use correct arguments to memcpy
(broken 19 Jul 1993).  From kjd@pescadero.stanford.edu (Kenneth
	Duda).
1994-02-21 19:44:01 +00:00
Ian Lance Taylor
c02fd8dc3e * read.c (do_align): Don't define label just_record_alignment
unless it might be used.
1994-02-10 22:32:21 +00:00
Ian Lance Taylor
ddb393cf89 * app.c (do_scrub_next_char): If NO_STRING_ESCAPES is defined,
don't treat backslash specially inside strings.
	* read.c (next_char_of_string): Likewise.
1994-02-09 18:11:20 +00:00
Steve Chamberlain
ede7bc1c60 * read.c (s_lcomm): Align lcomm data.
* config/tc-z8k.c (tc_reloc_mangle): Don't allow subtraction
	from different sections.
1994-01-31 15:28:06 +00:00
Ken Raeburn
4075afe126 * read.c (do_align): New function, most of guts of s_align_* functions. Look
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-30 23:29:20 +00:00
Ian Lance Taylor
ec7a69ea23 * read.c (lex_type): No longer make '{' a valid character for
symbol names.
1994-01-27 23:10:19 +00:00
Ken Raeburn
2ef7731dee read.c (s_lcomm): Treat Alpha like MIPS in handling of .sbss section. 1994-01-24 19:17:03 +00:00
David Edelsohn
d2550c72df * read.c (emit_expr): Fix computation of mask. 1994-01-15 17:33:16 +00:00
David Edelsohn
44ce2f3221 * expr.c (integer_constant): Fix computation of too_many_digits. Variable
digit_2 renamed to start.  Fix check for whether number will fit in 32 bits.
* read.c (emit_expr): Use valueT instead of long.
1994-01-12 01:04:10 +00:00
Ken Raeburn
30d3a445c4 removed an unnecessary comment 1993-12-15 16:23:27 +00:00
Jeff Law
48c3dee6f0 Fix typo in last change. 1993-11-28 19:57:00 +00:00
Jeff Law
385ce4337d * read.c (read_a_source_file): Fix test for when to stick a colon
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-28 06:54:04 +00:00
Ian Lance Taylor
46b8119005 * read.c (read_a_source_file): If we find a bad pseudo-op,
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-17 23:03:42 +00:00
Ian Lance Taylor
efe8ef02b2 * read.c (s_lcomm): Put small objects in .sbss for MIPS ELF as
well as MIPS ECOFF.
	(get_stab_string_offset): Remove unused variable aligned.
1993-11-02 23:15:58 +00:00
Ian Lance Taylor
ead1a4084e Fix tipo in comment. 1993-11-02 16:21:55 +00:00
Jeff Law
d191a03cf5 * read.c (get_stab_string_offset): Set SEC_DEBUGGING for any
stab section we make.
        (s_stab_generic): Likewise.
1993-10-31 07:38:33 +00:00
Jeff Law
d4c8cbd8ef * expr.c (make_expr_symbol): Delete DOT_LABEL_PREFIX code
and instead simply use the string defined by FAKE_LABEL_NAME.
        (operand): Likewise.
        * read.c (s_stab_generic): Likewise.
1993-10-31 02:13:34 +00:00
Ian Lance Taylor
80aab57939 Changes to let cons handle bignums like general expressions.
* 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-10-06 17:31:31 +00:00
Ian Lance Taylor
604633aeca * subsegs.c: Renamed non-BFD_ASSEMBLER subseg_new to subseg_set.
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-13 21:32:07 +00:00
Ian Lance Taylor
58d4951d00 gcc lint. See ChangeLog for details. Also:
* config/obj-elf.h (S_SET_SIZE): Actually set the size.
1993-09-10 16:01:07 +00:00
Ian Lance Taylor
abdd08c97c * read.c (get_stab_string_offset, s_stab_generic): If
BFD_ASSEMBLER, call subseg_set rather than subseg_new.
1993-09-09 19:09:23 +00:00
Stan Shebs
1531386bca Add missing ifdef to make m68k-aout targets happy. 1993-09-08 00:20:59 +00:00
Stan Shebs
4064305ec0 Changes to support stabs-in-coff 1993-09-07 17:39:56 +00:00
Ken Raeburn
ba71c54da8 (potable): Treat "string" like "asciz". 1993-08-18 20:53:03 +00:00
Ken Raeburn
b31f2abb70 (emit_expr): Use BFD_RELOC_64 fr 8-byte expressions. 1993-08-05 17:07:22 +00:00