Commit Graph

804 Commits

Author SHA1 Message Date
Ian Lance Taylor
20ae2fb832 * config/tc-mips.h (LOCAL_LABEL): Define as 0, for compatibility
with native MIPS assembler.
	* configure.in (mips-*-irix*): Don't set emulation.
	* config/te-irix.h: Remove.
With these changes, gas works with mips-tfile.
1994-08-24 23:46:53 +00:00
Ian Lance Taylor
fd4f335ccf * ecoff.c (ecoff_symbol_new_hook): Don't add a new file if we
haven't seen any input files yet.
	* config/tc-alpha.c (md_begin): Just call symbol_create, rather
	than calling symbol_new and then removing the symbol from the
	list.
With these changes, Alpha gas will work with mips-tfile.
1994-08-24 22:10:14 +00:00
Ian Lance Taylor
a2a1a548c7 gcc lint.
* as.c (main): Move a inside the #if 0 block which uses it.
	* ecoff.c (current_stabs_filename): Make const.
	* frags.h (frag_align_pattern): Declare.
	* gasp.c (new_file): Cast isp to long, and use %ld to print it.
	* config/tc-alpha.h (md_operand): Add cast to void.
	(alpha_do_align): Declare argument types.
	(tc_get_register): Declare.
	(alpha_frob_ecoff_data): Declare.
	* config/tc-alpha.c: Include <ctype.h>.
	(s_mask): Don't declare; does not exist.
	(line_comment_chars): Remove /* from descriptive comment.
	(tc_get_register): Remove unused local reg.
	(tc_gen_reloc): Don't bother to compare unsigned to zero.
	(s_base): Correct warning to actually print register number.
	(md_begin): Remove unused locals retval, lose, and i.
	(alpha_fix_adjustable): Move default case inside switch to avoid
	warning.
	(load_symbol_address): Remove unused locals reloc_addr, p, sym,
	and addend.
	(emit_byte_manip_r): Declare types for all arguments.
	(emit_extract_r, emit_insert_r, emit_mask_r): Likewise.
	(emit_sign_extend, emit_bis_r, s_proc): Likewise.
	(alpha_ip): Use sprint_value to print offsetT value.  Remove
	unused local size.  Remove unused label get_macro.
	(alpha_do_align): Make fill const.
	(md_apply_fix): Remove unused label check_zov.
1994-08-24 21:48:18 +00:00
Jeff Law
2cffb4f411 * config/tc-hppa.c (pa_comm): Set sy_resolved for the common
symbol.
1994-08-16 07:54:06 +00:00
Stu Grossman
a1dafd5511 * configure.in: Recognize ppc-*-netware.
* config/te-ppcnw.h:  New file to support Power-PC/Netware
	configurations.  Currently, it just enables the use of backslash
	escapes in string directives.
1994-08-10 02:47:48 +00:00
Ian Lance Taylor
55933a587a * config/tc-mips.c (md_parse_option): Accept -mcpu=4400, 4600, and
orion.
1994-08-09 15:18:26 +00:00
Steve Chamberlain
79b3ad4725 Fix copyright. 1994-08-08 23:37:38 +00:00
Jeff Law
fbf718862a * config/tc-hppa.c (create_new_space): Initialize sd_subspaces
field in the space chain.
1994-08-01 20:12:41 +00:00
Jeff Law
907f11fe71 * config/tc-hppa.c (tc_gen_reloc): Cast return value from
hppa_gen_reloc_type.
1994-08-01 08:44:02 +00:00
Ken Raeburn
5e0a90a8d7 * tc-sparc.c (sparc_ip): Check more carefully for conflicting architectures.
(md_parse_option) [NO_V9]: Complain if v9 was selected.
(md_show_usage): Derive architecture list in usage message from
architecture_pname array.
(cypress): Macro deleted.
(op_hash): Don't initialize.
(s_common): Use bfd_und_section_ptr instead of bfd_und_section.
(BSR): New function.
(sparc_ip): Use it for right-shift operations of 32 bits or more.
(sparc_ip): Implement new operand type 'x'.
1994-07-28 23:36:16 +00:00
Ken Raeburn
f68880ead9 ns32k files; i960xl sanitization 1994-07-26 22:20:48 +00:00
Ken Raeburn
9ca16e0e33 remove atof-ns32k.c 1994-07-15 22:28:22 +00:00
Ken Raeburn
462ab71d9b deleted atof-ns32k.c, no longer used 1994-07-14 21:58:13 +00:00
Ken Raeburn
259e35d4e9 updated ns532 support from Ian Dall 1994-07-14 18:58:06 +00:00
Ken Raeburn
6b510a40ae config/ho-sysv.h (realloc): Declare. 1994-07-13 01:28:47 +00:00
Kung Hsu
6f89cd429c Modified Files:
obj-ecoff.h obj-elf.h

        * config/obj-ecoff.h: define macro OBJ_GENERATE_ASM_LINE_STAB.
        * config/obj-elf.h: ditto.
1994-07-08 19:36:55 +00:00
Jeff Law
8fd04cbacc * config/tc-hppa.c (hppa_fix_adjustable): Reject reductions for
symbols in DLT relative relocs.
	(tc_gen_reloc): Zero out the addend field for DLT relative relocs.
1994-07-07 17:35:27 +00:00
Jeff Law
8fb99170f1 Fix thinko in last change 1994-07-05 01:18:23 +00:00
Jeff Law
655f3ef4af * config/tc-hppa.c (is_complex): New macro.
(cons_fix_new_hppa): "Handle" complex expressions.
1994-07-05 00:37:14 +00:00
Stan Shebs
6f0b87c329 * as.c (show_usage): Break long string into shorter ones.
(parse_args): Add -v, prints version id and continues.
	* config/tc-mips.c (md_show_usage): Break long string.
1994-06-30 00:55:33 +00:00
Stan Shebs
9e4eebc207 * mpw-config.in: Parse target and use to generate forward includes
to tc-, obj-, and atof- files, use te-generic.h for emulation.
	* mpw-make.in (VERSION): Define.
	(as.c): Compile with GCC.
	(TARG_OBJECTS, CLIBS): Define.
	(as.new): Use LDFLAGS, TARG_OBJECTS, CLIBS and EXTRALIBS in link
	command.
	(config.h, config-stamp): Build.
	config/ho-mpw.h (HOST_SPECIAL_INIT): Define.
1994-06-26 23:51:45 +00:00
Ken Raeburn
708e18fdc6 v9 unsanitization 1994-06-16 21:04:02 +00:00
Ken Raeburn
675ad6dc68 Fri Jun 3 17:25:08 1994 Pat Rankin (rankin@eql.caltech.edu)
* config/obj-vms.h (DBG_S_C_COMPLX4, DBG_S_C_COMPLX8): define
	these new VMS symbol-type macros for `complex float' and
	`complex double' support.  Their values come from the existing
	DSC$K_DTYPE_FC and DSC$K_DTYPE_DC macros in <descrip.h>.
	(DBG_S_C_REAL8_G, DBG_S_C_COMPLX8_G): G_float versions of
	REAL8 and COMPLX8; not used yet, because gcc outputs the same
	.stabs for `double' regardless of whether `-mg' is used.
	config/obj-vms.c (VMS_typedef_parse) [case 'r']: add entries
	for gcc2's predefined types "complex float", "complex double",
	and "complex long double" (identical to complex double).
1994-06-16 01:02:18 +00:00
Ian Lance Taylor
36a87ad7c5 * config/tc-mips.c (mips_ip): Permit non constant expressions in
'u' case: lets lui %hi(foo) work correctly.
1994-06-15 16:49:51 +00:00
Ian Lance Taylor
02d4e9238a Add weak symbols as an extension to a.out.
* read.c (pseudo_set): Only preserve external bit for OBJ_AOUT and
	OBJ_BOUT if not BFD_ASSEMBLER.
	* config/aout_gnu.h (N_WEAKU, N_WEAKA, N_WEAKT, N_WEAKD, N_WEAKB):
	Define as in ../include/aout/aout64.h.
	* config/obj-aout.h (OBJ_SYMFIELD_TYPE): If not BFD_ASSEMBLER,
	define as char.
	(S_GET_WEAK, S_SET_WEAK): Define if not BFD_ASSEMBLER.
	* config/obj-aout.c (obj_pseudo_table): Add "weak".
	(obj_emit_symbols): Adjust type of weak symbols.
	(obj_aout_weak): New static function.
1994-06-11 20:45:49 +00:00
Ian Lance Taylor
726672c5a5 * config/ho-sunos.h: Include <stdlib.h>. Don't declare malloc,
realloc, free, or atol.
1994-06-10 17:55:45 +00:00
Ian Lance Taylor
d2c71068e8 * config/tc-mips.c (RDATA_SECTION_NAME): Define.
(macro): Correct M_LI_SS SVR4_PIC/EMBEDDED_PIC case.  After M_LI_D
	or M_L_DOB or label dob, force a new frag to avoid getting
	confused in tc_gen_reloc.
	(mips_ip): Use RDATA_SECTION_NAME, not .rdata.
	(s_change_sec): Likewise.
1994-06-06 17:16:16 +00:00
David MacKenzie
baed44cd14 * as.c (show_usage), config/tc-alpha.c (md_show_usage),
config/tc-mips.c (md_show_usage): Fix up messages.
1994-06-03 21:19:02 +00:00
David MacKenzie
dbc0fdd792 improve usage message 1994-06-03 21:07:48 +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
David MacKenzie
f3d817d8b7 * as.c (show_usage): Remove target specific messages;
instead, call md_show_usage.
	(parse_args): Use getopt_long_only.  Take pointers to argc and
	argv.
	(main): Pass parse_args pointers.
	* as.h: Remove 3 variables that are redundant with flagseen.
	* as.c, messages.c: Change their users to use flagseen.
	Define getopt stuff.
	* tc.h: Update md_parse_option decl.  Add md_show_usage decl.
	* config/tc-*.c: Add md_shortopts, md_longopts,
	md_longopts_size, md_show_usage.  Change calling convention for
	md_parse_option.  Remove md_parse_long_option.
	* config/tc-ns32k.c: Rename `struct option' to `struct ns32k_option'.
	* config/tc-i386.h: Don't define md_parse_option.
1994-06-03 17:42:27 +00:00
Ken Raeburn
82489ea062 68060 support 1994-06-02 16:35:41 +00:00
Ken Raeburn
2283f8a02a (fixup_segment) [!BFD_ASSEMBLER] [DIFF_EXPR_OK]: Do conversion to pc-relative
for difference, even if pcrel is already set.
1994-06-02 16:18:33 +00:00
Ken Raeburn
0952861cab Handle EV5 (21164/66/68) PALcode support.
* config/tc-alpha.c (machine): New variable.
(load_insn): New macro.
(load_insn_table): New function.
(md_begin): Call load_insn_table, once for basic instructions and
once for appropriate PAL instruction table.
(md_parse_option): Set `machine' based on -m##### arguments.

* config/alpha-opcode.h (alpha_pal21064_opcodes): Split out from alpha_opcodes.
(alpha_pal21164_opcodes): New table.
(NUM21064OPCODES, NUM21164OPCODES): New macros.
1994-06-02 16:06:43 +00:00
Ian Lance Taylor
0221ddf71a * config/tc-mips.c (mips_ip): Force floating point values to be
aligned correctly.
1994-06-01 14:56:21 +00:00
Ken Raeburn
c06e55d99a changes from gas-2.3/binutils-2.4 dist (details in branch log msgs, changelogs) 1994-05-27 16:58:05 +00:00
Ian Lance Taylor
f9c57637e4 * config/tc-sparc.c (md_section_align): Don't change the size if
OBJ_ELF.
1994-05-19 19:44:02 +00:00
Jeff Law
44e8d616e5 * config/tc-hppa.c (pa_ip): Use R_HPPA_ABS_CALL, not R_HPPA for
absolute calls.
1994-05-18 15:18:23 +00:00
Jeff Law
ee8b834600 * config/tc-hppa.c (pa_parse_fp_cmp_cond): Report an error
on a partial completer match.
1994-05-17 18:54:50 +00:00
Jeff Law
3315c7c714 * config/tc-hppa.c: Change .hppa_unwind to .PARISC.unwind
throughout code.
	(is_complex): Delete definition and support for complex relocation
	types.
	(tc_gen_reloc): Delete special unwind crud for ELF.  Simplify and
	rewrite ELF code based on 94-02-02 PA ELF draft spec.
	(pa_build_unwind_subspace): Use standard PARISC_DIR32 relocs for
	the unwind descriptors.
1994-05-16 19:29:56 +00:00
Steve Chamberlain
a47d2dc447 Disable single quote strings. 1994-05-07 23:51:30 +00:00
Steve Chamberlain
c794f0aa85 * config/go32.mh: New makefile fragment for go32 crossing.
* configure.in (host==go32): Use new fragment.
1994-05-06 21:14:49 +00:00
Ken Raeburn
23a832d2b9 Note deleted files. 1994-05-06 00:03:20 +00:00
Ken Raeburn
a139d99b3c * config/obj-coff*.*: Merged coffbfd versions into coff versions, with a single
"#ifdef BFD_ASSEMBLER" controlling most of it for now.  Deleted obj-coffbfd.*
files.
* configure.in: Always use obj-coff.* for COFF targets.
1994-05-05 21:38:25 +00:00
Ken Raeburn
608a26dbb2 * config/te-dpx2.h (TARGET_FORMAT, REGISTER_PREFIX_OPTIONAL): Define.
* configure.in (m68k-bull-sysv3*): Enable.
1994-05-04 20:24:51 +00:00
Ken Raeburn
7617444ce7 not used 1994-05-04 17:33:50 +00:00
Ian Lance Taylor
9fc63ce06a * config/obj-coffbfd.c (fixup_segment): Make common symbol and PC
relative adjustments when TE_LYNX is defined as well as when
	TC_I386 is defined.
1994-05-04 15:31:17 +00:00
Ken Raeburn
8fb85d50cd * obj-coff.h (TARGET_FORMAT) [TC_I960]: Select little endian version.
* obj-coffbfd.h (TARGET_FORMAT) [TC_I960]: Ditto.

* obj-coff.c (coff_frob_section): Round up the size of every section to a
multiple of the alignment, so that BFD doesn't surprise us.

Eliminate many simple differences between the two COFF back ends:

* obj-coffbfd.c: Removed all uses of DEFUN and DEFUN_VOID.  Made minor
stylistic changes, deleted some register declarations.
(stack_top): Deleted.
(symbol_to_chars): Use absolute_section and reg_section instead of the
corresponding SEG_* symbols.
(obj_coff_endef, tag_find_or_make, fixup_segment): Likewise.
(stack typedef, stack_init, stack_delete, stack_push, stack_pop): Moved to just
after pseudo-op table.  All functions now static.
(stack_delete): Removed declaration.
(tag_init, tag_insert, tag_find_or_make, tag_find): Moved to just after stack
functions.
* obj-coffbfd.h: Reordered some declarations and macros.
(stack_init, stack_delete, stack_push, stack_pop): Don't declare.
(stack typedef): Deleted.
(SYMBOLS_NEED_BACKPOINTERS): Always undef then define; don't test.
(SYM_AUXENT): New macro.
(SA_GET_*, SA_SET_*): Define in terms of SYM_AUXENT when feasible.
(SF_GET_*, SF_SET_*): Define in terms of SF_GET when feasible.
(SA_GET_SYM_TAGNDX, SA_GET_SYM_ENDNDX, SA_SET_SYM_TAGNDX, SA_SET_SYM_ENDNDX,
object_headers typedef, data_section_header, text_section_header): Delete
non-BFD_HEADERS versions, since we always define that symbol now.

* obj-coff.c (stack_top): Deleted.
(obj_coff_endef, obj_coff_dim, obj_coff_line, obj_coff_size, obj_coff_scl,
obj_coff_tag, obj_coff_type, obj_coff_val): Change argument name from "ignored"
to "ignore".
(obj_coff_val): Use frag_now_fix.
(obj_pseudo_table): Removed IGNORE_DEBUG version, since it doesn't get used.
(stack typedef, stack_init, stack_delete, stack_push, stack_pop): Moved to just
after pseudo-op table.  All functions now static.
(tag_init, tag_insert, tag_find_or_make, tag_find): Moved to just after stack
functions.
* obj-coff.h: Reordered some declarations and macros.  Protected against
multiple inclusions.
(stack_init, stack_delete, stack_push, stack_pop): Don't declare.
(stack typedef): Deleted.
(SYMBOLS_NEED_BACKPOINTERS): Always undef then define; don't test.
(stdoutput): Deleted declaration.
(TARGET_FORMAT) [TC_I386]: Don't define if already defined.
1994-05-04 06:19:26 +00:00
Ken Raeburn
326aa685fe * tc-m68k.c (flag_reg_prefix_optional): New variable. Initialized to value of
REGISTER_PREFIX_OPTIONAL, if defined, or zero.
(m68k_reg_parse): If flag_reg_prefix_optional is set, permit register prefix to
be absent.
(m68k_ip_op): Accept `&' also for immediate constants.
(insert_reg): Don't bother with (two!?) sanity checks of the symbol table when
inserting each register.
(m68k_parse_long_option): New function.  Set flag_reg_prefix_optional if
"register-prefix-optional" is passed.
* tc-m68k.h (REGISTER_PREFIX): Always define if not already defined.
(OPTIONAL_REGISTER_PREFIX): Don't define.
(REGISTER_PREFIX_OPTIONAL): If not already defined, define as zero
or one depending on M68KCOFF.

Some changes to help Apollo support, from troy@cbme.unsw.edu.au:
* tc-m68k.c (DATA, ADDR, SP, FPREG, COPNUM, BAD, BAC): Define as macros instead
of enumerators, since the Apollo compiler can't handle "enumVal1, enumVal2 =
enumVal1" when defining an enum type.
(make_pcrel_absolute) [NO_PCREL_RELOCS]: New function.
(tc_coff_fix2rtype) [NO_PCREL_RELOCS]: Generate only R_RELBYTE, R_DIR16, and
R_DIR32 relocs.
* tc-m68k.h [TE_APOLLO] (COFF_MAGIC, COFF_AOUTHDR_MAGIC): Use Apollo versions.
[TE_APOLLO] (OBJ_COFF_OMIT_OPTIONAL_HEADER): Undefine.  That is, do include the
optional header for Apollo target.
(COFF_MAGIC): Don't define as MC68MAGIC if it's already defined.

* tc-m68k.h [TE_DELTA] (LEX_PCT): Define as 1, so that `%' can be used within a
label name.

* tc-m68k.h (m68k_init_after_args): Declare.
(tc_init_after_args): Define as m68k_init_after_args.
* tc-m68k.c (m68k_init_after_args): New function, containing one-shot code from
md_assemble.  Added warning for combination of 68040 and 68851.
(md_assemble): Startup-time code deleted.
1994-04-26 22:21:15 +00:00
Ken Raeburn
fb51366fe8 * config/obj-coffbfd.c (fill_section): Check COFF_NOLOAD_PROBLEM
also before setting STYP_NOLOAD for .bss section.
1994-04-26 21:28:49 +00:00
Ken Raeburn
988238d380 * config/obj-coff.c (obj_symbol_new_hook): Don't need to strip underscores,
since symbol_new will already have done it.
* config/obj-coffbfd.c (obj_symbol_new_hook): Ditto.
1994-04-22 20:39:01 +00:00
Ian Lance Taylor
6fdc26e663 * config/tc-mips.c (append_insn): Permit branches to be switched
with the preceding instruction even if .set nobopt has been seen.
	.set nobopt actually controls whether to bring up an instruction
	from the branch target, which gas does not currently support.
1994-04-21 19:53:25 +00:00
Ken Raeburn
71b4de6fb8 * config/obj-coff.h, config/obj-coff.c: Deleted all code used only when
BFD_ASSEMBLER is not defined, and all conditionals relating to such code.  No
such targets remain.

Fixes for stabs-in-coff:
* config/obj-coff.c: Include subsegs.h.
(coff_frob_section): New function.
(obj_coff_init_stab_section): New function.
* config/obj-coff.h (obj_coff_init_stab_section, coff_frob_section): Declare.
(obj_frob_section): New macro; uses coff_frob_section.
(INIT_STAB_SECTION): New macro; uses obj_coff_init_stab_section.
1994-04-20 23:01:40 +00:00
Ken Raeburn
ad8019e829 (VMS_write_object_file): While looking for register mask, skip empty fill frags
caused by enabling listing output.
1994-04-19 01:12:48 +00:00
Ken Raeburn
77c36070dd Include string.h. 1994-04-19 01:08:38 +00:00
Jeff Law
9de7c1fc8d * config/tc-hppa.c (pa_parse_space_stmt): Use the built-in
defaults for defined, private, and spnum fields for the
        $TEXT$ and $PRIVATE$ spaces.  Do not clobber spnum.  Do
        not reset the segment if just updating a space.
        (pa_spaces_begin): Set BFD section flags for all built-in
        subspaces.
1994-04-18 21:29:28 +00:00
Ken Raeburn
c92d9ee900 * Makefile.in: Make $(OBJS) depend on $(ALL_OBJ_DEPS).
* configure.in: Set ALL_OBJ_DEPS in output Makefile.

Based on suggestions from <BAILEY@hmivax.humgen.upenn.edu> (Charles Bailey):
* vmsconf.sh: In generated file, get ".obj" suffix right, build source files
from other directories into objects in the current directory, and specify PSECT
attributes explicitly to linker.  Also added missing label.
* Makefile.in (stamp-mk.com): Reference new variable VMS_OTHER_OBJS for list of
non-local object files, instead of listing them here.
(VMS_OTHER_OBJS): New variable, added more libiberty files.
* make-gas.com: Regenerated.

* config/ho-vms.h (unlink): Define as delete.

* config-gas.com: Fix quoting on TARGET_CANONICAL definition.  Delete files
before creating them.
1994-04-14 22:46:53 +00:00
Ian Lance Taylor
2f06dd5c75 Remove assertion that was not intended to be checked in. 1994-04-14 17:59:14 +00:00
Ian Lance Taylor
ecd4ca1cef * config/tc-mips.h (DIFF_EXPR_OK): Define.
* config/tc-mips.c (macro_build): Permit BFD_RELOC_PCREL_LO16 for
	certain cases of 'i', 'j' and 'o'.  Change 'u' to take an
	argument, the reloc type.
	(load_register): Pass reloc type to macro_build for 'u'.
	(macro): Likewise.  For M_LA_AB permit a difference expression
	when generating embedded PIC code between an arbitrary symbol and
	a symbol in the .text section.
	(mips_force_relocation): Force BFD_RELOC_PCREL_HI16_S and
	BFD_RELOC_PCREL_LO16 to be emitted.
	(md_apply_fix): Check that most relocs are not PC relative.
	Handle BFD_RELOC_PCREL_HI16_S and BFD_RELOC_PCREL_LO16.
	(tc_gen_reloc): Change #error to as_fatal.  Handle
	BFD_RELOC_PCREL_LO16 and BFD_RELOC_PCREL_HI16_S.
1994-04-14 17:39:55 +00:00
Jeff Law
caed9e8251 * config/tc-hppa.c (pa_procend): Handle case where label was
defined after the .proc directive.
1994-04-11 16:11:12 +00:00
Jeff Law
0521099057 * config/tc-hppa.c (pa_procend): Give an error if we encounter a
procend for a procedure without a name.
1994-04-11 16:02:12 +00:00
Ken Raeburn
38d693ff69 note deleted .mt files 1994-04-07 23:02:49 +00:00
Ian Lance Taylor
1c803e5223 * config/tc-mips.c (macro): Pass NULL for expression argument to
macro_build for nori case.
	(SWITCH_TABLE): Define.
	(mips_force_relocation): Force a relocation for a switch table
	entry.
	(md_apply_fix): Write switch table entry value into file.
	(tc_gen_reloc): Use BFD_RELOC_GPREL32 for a switch table entry,
	and set the addend to the difference between the reloc address and
	the subtrahend.
1994-04-07 18:33:09 +00:00
Jeff Law
0b503989f5 * config/tc-hppa.h (elf_tc_symbol): Delete. No longer used.
(elf_tc_make_sections): Likewise.
        (hppa_tc_make_sections, hppa_tc_symbol): Delete extern decls.

        * config/tc-hppa.c (hppa_tc_make_sections): Delete function.
        (hppa_tc_symbol): Likewise.

        * config/obj-elf.c (elf_frob_file): Delete elf_tc_symbol and
        elf_tc_make_sections stuff.  It was there to support PA braindamage
        which has been fixed, and in the case of elf_tc_make_sections is
        redundant with elf_tc_final_processing.
1994-04-07 17:39:16 +00:00
Ian Lance Taylor
f3645945cf * config/tc-mips.c (mips_ip): For case 'o', when generating
embedded PIC code, accept the difference between two local symbols
	as being constant.
	(mips_force_relocation): Only force a reloc to be generated for a
	PC relative fixup.
	(md_apply_fix): For BFD_RELOC_32 and BFD_RELOC_LO16, put the fixup
	value into the file if the fixup will not generate a reloc.
1994-04-05 19:57:32 +00:00
Ken Raeburn
a7129c48cf (s_reserve): If section passed isn't bss, don't spew remainder of input file in
error message.
(tc_gen_reloc): If bfd_reloc_type_lookup returns null, print error
message with reloc type and try to process remainder of file.
1994-04-05 18:16:37 +00:00
Jeff Law
79381848ca * config/tc-hppa.c (tc_gen_reloc): Fix thinko in ELF version. 1994-04-05 00:06:46 +00:00
Ian Lance Taylor
1e147242d7 * config/tc-ppc.c (ppc_size): New static variable.
(ppc_arch): Check for PPC_OPCODE_PPC before PPC_OPCODE_POWER.
	(md_begin): If an instruction has a size specific flag set, only
	add it if we are assembling that size.
1994-04-04 16:42:16 +00:00
Ian Lance Taylor
7ab2e983d6 * config/tc-sparc.c (tc_gen_reloc): Add a gruesome hack to get
cross section PC relative relocs right for COFF and ELF.
1994-03-31 21:54:06 +00:00
Ken Raeburn
75d20ac894 * config/obj-coff.h (SEPARATE_STAB_SECTIONS): Always define.
(OBJ_PROCESS_STAB): Don't define.
1994-03-28 19:40:53 +00:00
Ian Lance Taylor
882bdc6952 Mon Mar 28 12:35:00 1994 David Edelsohn (edelsohn@npac.syr.edu)
* config/tc-ppc.c (md_parse_option): Add -mpwrx (POWER/2 aka
	RIOS2), -mpwr (POWER aka RIOS1), -mppc (PowerPC aka MPC603/604),
	and -many (all architectures).
1994-03-28 17:38:39 +00:00
Jeff Law
de3ffc7aef * config/tc-hppa.c (tc_gen_reloc): Set addend for relocation
involving a function symbol which is not a plabel to zero.
        (md_apply_fix): Never pass a function symbol to field_adjust.
1994-03-27 22:05:21 +00:00
Ian Lance Taylor
645f842c99 * config/obj-aout.c (obj_aout_frob_symbol): If N_EXT is set for an
N_INDR symbol, set BSF_EXPORT and clear BSF_LOCAL.
1994-03-25 22:53:40 +00:00
Ian Lance Taylor
5b63f465fc * config/tc-mips.c (append_insn): If EMBEDDED_PIC, don't swap a
branch with an instruction that uses $at, in case the branch is
	later expanded.
	(macro): If EMBEDDED_PIC, case M_JAL_A may use $at.
	(md_pcrel_from): If not OBJ_AOUT, return 4 for an undefined symbol
	to make it pcrel_offset.
	(tc_gen_reloc): If not OBJ_AOUT, set the reloc addend to
	reloc->address; another gruesome hack to get gas reloc handling to
	do the right thing.
1994-03-25 22:40:44 +00:00
Ian Lance Taylor
7dfa376e9b Handle .gpword and .cpadd only for SVR4_PIC, not != NO_PIC. Still
covered by last ChangeLog entry.
1994-03-23 00:43:48 +00:00
Ian Lance Taylor
d9aba8051e * config/tc-mips.c (enum mips_pic_level): New enum.
(mips_pic): Change from int to enum mips_pic_level.  Change all
	uses (0 becomes NO_PIC, 2 becomes SVR4_PIC).
	(load_address): Handle EMBEDDED_PIC.
	(macro): Handle EMBEDDED_PIC in all PIC cases.
	(md_parse_option): Accept -membedded-pic to use EMBEDDED_PIC.  If
	OBJ_ELF, accept -KPIC and -call_shared to use SVR4_PIC and accept
	-non_shared to use NO_PIC (this is how the Irix 5 assembler
	works).  Do not permit -G with SVR4_PIC.
	(s_abicalls): Warn if -G was used, and force -G 0.
	(tc_gen_reloc): Set reloc->addend to 0 for a PC relative reloc for
	anything but a.out, not just for ELF.  For ECOFF, don't generate a
	BFD_RELOC_16_PCREL_S2 reloc unless using EMBEDDED_PIC.
1994-03-22 20:27:58 +00:00
Ken Raeburn
c37f6138d4 * Makefile.in (config-stamp): If `defs' is defined, emit a preprocessor
directive to create a macro named by this value into config.new; don't
explicitly go for BFD_ASSEMBLER.
* configure.in: Define `defs', not `BFDDEF'.  Set it to MANY_SEGMENTS for any
obj-coffbfd target.
* config/obj-coffbfd.h (BFD_HEADERS, BFD): Define.
* config/i386coff.mt (TDEFINES): Don't define BFD, MANY_SEGMENTS, BFD_HEADERS.
(LOCAL_LOADLIBES): Deleted.
* config/m68kcoff.mt (TDEFINES): Don't define those macros.
* config/m88kcoff.mt (TDEFINES): Ditto.
* config/ebmon29k.mt: Deleted.
* config/h8300hds.mt: Deleted.
* config/ic960coff.mt: Deleted.
* config/sparc.mt: Deleted.
* config/h8300.mt (LOCAL_LOADLIBES, TDEFINES): Deleted.
* config/h8500.mt (LOCAL_LOADLIBES, TDEFINES): Deleted.
* config/sh.mt (LOCAL_LOADLIBES, TDEFINES): Deleted.
* config/z8k.mt (LOCAL_LOADLIBES): Deleted.
(TDEFINES): Don't define the coffbfd macros.

* Makefile.in: Insert makefile fragments before OBJS definition.
(OBJS): Add $(TE_OBJS).
1994-03-20 21:13:59 +00:00
Ken Raeburn
a9997275f9 (TDEFINES): Fixed typo (MANY_SECTIONS, not MANY_SEGMENTS). 1994-03-19 01:26:55 +00:00
Jeff Law
49ccc55510 * config/tc-hppa.c (pa_import): Correctly handle importing of an
already defined symbol.
1994-03-17 21:37:42 +00:00
Jeff Law
c38c91dadb * config/tc-hppa.c (pa_equ): Handle both .reg and .equ correctly. 1994-03-17 00:49:30 +00:00
Jeff Law
f2ada9106d * config/tc-hppa.c (pa_callinfo): Accept "millicode" as an
argument to a .callinfo directive.  Don't loop forever on errors.
1994-03-16 22:42:51 +00:00
Ian Lance Taylor
d6e6bc1c52 * config/obj-coffbfd.c (adjust_stab_section): Initialize
stabstrseg to SEG_UNKNOWN, not -1.  After loop, check whether it
	is not SEG_UNKNOWN rather than checking whether it is >= 0.
1994-03-16 22:22:17 +00:00
Ian Lance Taylor
23dc1ae33d * config/tc-mips.c (mips_align): Take new argument, label, and use
it instead of global insn_label.
	(s_align, s_cons, s_float_cons, s_gpword): Save insn_label before
	call to mips_emit_delay and pass it to mips_align.
1994-03-16 22:16:02 +00:00
Ken Raeburn
54ce399a27 keep ic960coff.mt 1994-03-15 03:36:27 +00:00
Ken Raeburn
abf434d83d (VMS_Initialized_Data_Size): Cache symbol values to reduce number of lookups
with S_GET_VALUE.  Skip debug symbols to avoid "a really nasty bug".  (From
Holger Teutsch, holger@botbso.rhein-main.de.)
(VMS_write_object_file): For "__vt.*" symbols, set S_GET_OTHER field.  (Also
from Holger Teutsch.)  Watch for a would-be register mask that spans frags.
1994-03-15 03:05:24 +00:00
Ken Raeburn
8304c303d6 (obj_coff_line): Set symbol lnno field with this_base, not line_base. (Patch
from Andreas Arens, ari@obelix.av.rwth-aachen.de.)
1994-03-15 03:02:17 +00:00
Ken Raeburn
7d5366dd28 Include aout/stab_gnu.h.
(N_GSYM, ..., N_LENG): Deleted.
(NO_RELOC): Undefine before defining as part of enum reloc_type.
1994-03-11 23:07:26 +00:00
Ken Raeburn
c17f46667a (Close_VMS_Object_File): Add comment pointing out some code that doesn't belong
in this file.
1994-03-11 23:07:00 +00:00
Ian Lance Taylor
be22008b2c * config/tc-mips.c (mips_ip): Accept numbers between 0x8000 and
0xffff for 'j' to be compatible with MIPS assembler.  These
	numbers are actually treated as negative.
1994-03-11 23:00:17 +00:00
Ken Raeburn
40cd35fffd Handle Alpha load-immediate-FP pseudo-instructions:
* config/alpha-opcode.h (ldif, ldig, ldis, ldit): New patterns.
* config/tc-alpha.c (lit8_sec, lit4_sec, lit8_sym, lit4_sym): New variables.
(create_literal_section): New function.
(create_lita_section): Now a macro.
(get_lit8_offset, get_lit4_offset): New functions.
(maybe_set_gp): New function.
(select_gp_value): Call it.
(load_expression): Preserve addend if symbol is a section symbol.
(alpha_ip): Handle new operand type `F' for floating-point constants; store
them in .lit{4,8} sections.
(alpha_ip, case 'G'): Emit LITUSE relocations for symbol exprs.
1994-03-09 02:44:00 +00:00
Ken Raeburn
055a75ef75 * config/obj-coff.c: Minor formatting/stylistic changes, plus:
(obj_coff_section): Declare.
(obj_pseudo_table): Make it available only if MANY_SECTIONS.
(obj_symbol_to_chars) [CROSS_COMPILE]: Some attemps to make this work.  It
still doesn't.  It now fails to compile, instead of silently compiling to do
nothing.
* config/obj-coff.h (SEPARATE_STAB_SECTIONS): Define only if MANY_SECTIONS.
(OBJ_PROCESS_STAB) [! MANY_SECTIONS]: New macro, just emits a warning.
1994-03-09 02:42:57 +00:00
Ian Lance Taylor
8ea7f4e854 * config/tc-mips.c (load_address): When calling frag_grow, allow
for the (up to) two nops which may be inserted by append_insn if
	mips_optimize is 0.
	(macro): Likewise.
1994-03-07 21:12:26 +00:00
Jeff Law
fb338f1d79 * config/tc-hppa.c: Add a few casts to make HP C compiler happy.
* config/obj-som.c (obj_som_version, obj_som_copyright): Be prepared
        to handle an error from bfd_som_attach_aux_hdr.
1994-03-02 20:02:17 +00:00
Ken Raeburn
30869211ae (md_atof): Omit warning about FP values.
(line_comment_chars): Add ! to list.
(md_apply_fix): Do process 32- and 64-bit relocations.
1994-02-28 21:13:23 +00:00
Ken Raeburn
c535f6bca6 * configure.in (i960-*-coff, i960-*-vxworks5.*): Use coffbfd, and gas_target
ic960coff.
* config/ic960coff.mt: New file.
* config/obj-coffbfd.h [TC_I960]: Include coff/i960.h.
(TARGET_FORMAT) [TC_I960]: Use coff-Intel-little.
* config/te-ic960.h (CROSS_COMPILE): Don't undef this.  We'll always build
little-endian object files.
* config/tc-i960.c (md_reloc_size): Don't define at all if BFD or
BFD_ASSEMBLER is defined.
(mem_fmt): Since COFF doesn't handle callx relocations yet, treat them like
normal 32-bit relocations.
(md_apply_fix): For callx relocations, store zero.
(tc_bout_fix_to_chars): Store symbol idx for all callx relocations, regardless
of link-relax setting.
(tc_coff_fix2rtype, tc_coff_sizemachdep): New functions.
(i960_handle_align) [! OBJ_BOUT]: If link-relax option is selected, print an
error message and clear it.
* config/tc-i960.h (BFD_ARCH, COFF_FLAGS, COFF_MAGIC, TC_COUNT_RELOC,
TC_COFF_FIX2RTYPE, TC_COFF_SIZEMACHDEP, tc_fix_adjustable): New macros.
(tc_coff_fix2rtype, tc_coff_sizemachdep): Declare.
1994-02-28 21:11:17 +00:00
Ken Raeburn
442f17dc56 (obj_coff_lcomm): Put "#if 0" around the unused parts (most of the function).
(obj_coff_init_stab_section): Cast alloca result.
1994-02-28 21:06:26 +00:00
Jeff Law
e03095c9bb * config/tc-hppa.c (hppa_tc_symbol): Call PA ELF BFD version.
(hppa_tc_make_sections): Likewise.
        (pa_build_symextn_section): Delete unused function.
        (hppa_tc_make_symextn_section): Likewise.
        (pa_export): Delete call to pa_build_symextn_section.

        * config/tc-hppa.h (hppa_tc_symbol): Add extern decl.
        (elf_hppa_final_processing): Delete extern decl.
        (hppa_tc_symbol): Delete extern decl.
1994-02-26 04:57:57 +00:00
Ian Lance Taylor
3919ffeb06 * config/obj-coffbfd.c (fill_section): Correct test for whether to
fill a section (from Minh Tran-Le <TRANLE@intellicorp.com>).
1994-02-25 21:16:56 +00:00
Jeff Law
cb6af92833 * config/ho-hppaosf.h: Fix braino in test for ANSI-C. 1994-02-24 15:11:19 +00:00
Ken Raeburn
c9c45af14e this is i386-mach3 *host* support (not target like in last mistaken msg)... 1994-02-22 18:09:19 +00:00
Ken Raeburn
75ec0c908b keep te-mach.h 1994-02-22 17:57:49 +00:00
Ian Lance Taylor
380fa957e5 * config/obj-coffbfd.c (write_object_file): use bfd_get_error (),
not bfd_error.
	* config/obj-elf.c (elf_frob_file): Likewise.
1994-02-22 03:49:59 +00:00
Ian Lance Taylor
c8d02404ea * config/ho-hpux.h (BROKEN_ASSERT): Define if not __GNUC__. 1994-02-21 23:17:59 +00:00
Ken Raeburn
5efa30faad keep new te-mach.h 1994-02-18 22:04:40 +00:00
Ken Raeburn
06471862ca First attempt at i386-mach3 support.
te-mach.h: New file.
obj-aout.c (obj_aout_frob_file): New function.
obj-aout.h (obj_aout_frob_file): Declare it.
(frob_file): New macro.
tc-i386.c (md_apply_fix_1) [TE_Mach]: Don't adjust pcrel32 relocations.
tc-i386.h (TARGET_FORMAT) [TE_Mach]: Use a.out-mach3.
1994-02-18 19:57:35 +00:00
Ian Lance Taylor
4045fbb497 * config/tc-i386.c (md_pseudo_table): Remove "zero".
* config/tc-m88k.c (md_pseudo_table): Likewise.
1994-02-10 16:27:34 +00:00
Stan Shebs
66c774bb3e Wed Feb 9 09:42:45 1994 Stan Shebs (shebs@andros.cygnus.com)
* config/obj-coffbfd.c (obj_coff_init_stab_section): Use memset
	instead of memcpy to zero the initial stab symbol, duh.
	* config/obj-elf.c (obj_elf_init_stab_section): Ditto.
	* config/obj-som.c (obj_som_init_stab_section): Ditto.
1994-02-09 17:47:40 +00:00
Ken Raeburn
cf272f0244 (load_expression): Parenthesize operations in range checking, to avoid
precedence questions.

(addr32): New static variable.
(md_parse_option): Set it for "-32addr".
(load_symbol_address): If addr32 is set, use ldl instead of ldq.
1994-02-07 21:12:03 +00:00
Ken Raeburn
4a6e1a39e7 * tc-alpha.c (md_section_align): Change second argument and
return type to valueT, to agree with tc.h.
(alpha_do_align): Local static array nop_pattern is now unsigned
char, to avoid overflow warnings.
* tc-alpha.h (md_section_align): Delete declaration.

* obj-ecoff.c (ecoff_frob_file): Ensure that ecoff_data for
output bfd is non-null before indirecting through it.

Crock to get GP set right:
* tc-alpha.c (alpha_frob_ecoff_data): Renamed from alpha_frob_file.
* tc-alpha.h (tc_frob_file): Macro deleted.
* obj-ecoff.c (ecoff_frob_file) [TC_ALPHA]: Call alpha_frob_ecoff_data, then
fill in optional-header info with gp value and register masks.
1994-02-07 10:11:43 +00:00
Stan Shebs
41b5ef0f76 Sat Feb 5 12:30:32 1994 Stan Shebs (shebs@andros.cygnus.com)
* config/obj-coffbfd.c (obj_coff_init_stab_section): Zero the
	initial stab symbol after allocating it.
	* config/obj-elf.c (obj_elf_init_stab_section): Ditto.

This fixes a critical bug observed in Q4 for Lynx.
1994-02-05 21:45:51 +00:00
Ian Lance Taylor
af46c203df New files for PowerPC/POWER (RS/6000) support. 1994-02-05 05:35:11 +00:00
Ian Lance Taylor
11c0749600 Revert last change. 1994-02-04 03:17:30 +00:00
Ian Lance Taylor
fdb3408e12 * config/tc-mips.c (md_apply_fix): If this is an undefined symbol,
subtract the value from fx_addnumber to since
	bfd_perform_relocation is going to add it in.
1994-02-04 02:32:54 +00:00
Ian Lance Taylor
1051c97f63 * config/tc-mips.c (file_mips_isa): New static variable.
(md_begin): Set it.
	(s_mipsset): Add support for .set mipN to set the ISA level.
1994-02-02 17:06:24 +00:00
Ken Raeburn
5ca42ea386 * config/ho-i386aix.h: Include sys/types.h and stdlib.h, not ho-sysv.h. Based
loosely on a patch from Minh Tran-Le.
1994-02-02 00:32:10 +00:00
Ian Lance Taylor
8bbad6fda8 * config/tc-mips.c (mips_ip): Make an unsupported instruction a
warning, not an error.
1994-02-01 23:10:05 +00:00
Ian Lance Taylor
96a8876071 * config/obj-coffbfd.c (symbol_to_chars): bfd_coff_swap_aux_out
now takes more arguments.
1994-02-01 17:18:42 +00:00
Ian Lance Taylor
257df7914d * config/obj-coff.c (dot_text_symbol, dot_data_symbol,
dot_bss_symbol): Don't define if BFD_ASSEMBLER.
	(obj_symbol_to_chars): bfd_coff_swap_aux_out now takes more
	arguments.
	(coff_line_base): Renamed from line_base.  Changed all uses.
	(coff_add_linesym): Renamed from add_line_sym.  Made non-static.
	Changed all uses.
	* config/obj-coff.h: If TC_PPC, include coff/rs6000.h.
	(S_SET_STORAGE_CLASS, S_GET_STORAGE_CLASS): Declare if
	BFD_ASSEMBLER.
	(coff_line_base): Declare.
	(coff_add_linesym): Declare if BFD_ASSEMBLER.
1994-02-01 17:17:52 +00:00
Ken Raeburn
4242632039 (Already checked in write.c and config/tc-alpha.c, but no log msg went
out because $CVSROOT was wrong...)

	* write.c (write_object_file): If tc_frob_file is defined, call it
	just before calling obj_frob_file.
	* config/tc-alpha.c (alpha_gp_value): Renamed from gp_value
	(references changed), and made non-static.
	(getExpression): Return void.
	(select_gp_value): Abort if gp_value is non-zero.  Delete call to
	non-existent bfd_set_gp_value.
	(alpha_validate_fix): Function deleted.
	(alpha_frob_symbol): Function deleted.
	(alpha_local_label): Function deleted.
	(alpha_frob_file): Renamed from alpha_end.
	* config/tc-alpha.h (alpha_frob_symbol, alpha_validate_fix,
	alpha_local_label, alpha_end): Declarations deleted.
	(alpha_gp_value, alpha_frob_file): Declare.
	(tc_frob_symbol, TC_VALIDATE_FIX, md_end): Macros deleted.
	(LOCAL_LABEL): Move code here from tc-alpha.c:alpha_local_label.
	(md_convert_frag): Simplified slightly.
	(tc_frob_file): New macro.
1994-01-30 23:26:55 +00:00
Ken Raeburn
c79e67a3b7 * write.c (write_object_file): If tc_frob_file is defined, call it
just before calling obj_frob_file.
* config/tc-alpha.c (alpha_gp_value): Renamed from gp_value (refs changed), made
non-static.
(getExpression): Return void.
(select_gp_value): Abort if gp_value is non-zero.  Delete call to non-existent
bfd_set_gp_value.
(alpha_validate_fix): Function deleted.
(alpha_frob_symbol): Function deleted.
(alpha_local_label): Function deleted.
(alpha_frob_file): Renamed from alpha_end.
* config/tc-alpha.h (alpha_frob_symbol, alpha_validate_fix, alpha_local_label,
alpha_end): Declarations deleted.
(alpha_gp_value, alpha_frob_file): Declare.
(tc_frob_symbol, TC_VALIDATE_FIX, md_end): Macros deleted.
(LOCAL_LABEL): Move code here from tc-alpha.c:alpha_local_label.
(md_convert_frag): Simplified slightly.
(tc_frob_file): New macro.
1994-01-30 23:21:55 +00:00
Ian Lance Taylor
1f029792a2 * config/obj-coff.c (obj_coff_section_header_append): Do not
declare if BFD_ASSEMBLER.
	(stack_pop): Correct test for stack underflow.
	(obj_coff_endef, obj_coff_dim, obj_coff_line, obj_coff_size,
	obj_coff_scl, obj_coff_tag, obj_coff_type, obj_coff_val): Declare
	type of ignored argument to avoid gcc warning.
	(align): Removed unused function.
1994-01-28 16:30:29 +00:00
Ken Raeburn
0b233d31df removed rcs cruft 1994-01-28 05:38:41 +00:00
Ken Raeburn
5749c49700 New Alpha support files, based on files from CMU.
Still to do:
 - fix floating-point handling
 - figure out if we can adapt to using ../opcodes/alpha-opc.h
 - gcc bootstrap testing
 - 32-bit mode support?
 - test cross-assembly
1994-01-28 01:37:02 +00:00
Ken Raeburn
98c6bbbe43 * as.h: If __GNUC__ and inline are both undefined, define inline away.
* write.c (cvt_frag_to_fill): Don't assume that fr_var for rs_align or rs_org
frags will be 1.
(relax_segment): For rs_align, if fr_var is not 1, complain if
required padding is not a multiple of the size of the pad pattern.
(fixup_segment): Leave gp-relative relocations alone.  For pcrel relocations
referring to the same segment, clear fx_pcrel when clearing fx_addsy.
* as.h: Adjust comments on rs_align.

* write.c, config/obj-{aout,bout,coff*}.c, config/tc-sparc.c: Query the fx_done
field instead of fx_addsy to see if the fixup still needs to be applied.  Set
fx_done and clear fx_addsy both, for now.  If TC_HANDLES_FX_DONE isn't defined,
assume md_apply_fix will only clear fx_addsy, and set fx_done accordingly after
returning.
* config/tc-sparc.h (TC_HANDLES_FX_DONE): Define.

* config/obj-coff.c (dot_text_symbol, dot_data_symbol, dot_bss_symbol): Defined
here, static.

* config/obj-aout.c [BFD_ASSEMBLER]: Undef NO_RELOC before including aout/aout64.h.

* write.c (write_object_file): If EMIT_SECTION_SYMBOLS is false, don't write
out a section symbol even if it's used in a relocation; assume relocations will
handle section numbers somehow.  Rename "punt_it" label to "punt_it_if_unused"
to reflect it's true use.
(EMIT_SECTION_SYMBOLS): Default to 1.
(adjust_reloc_syms): Don't create a new symbol for an absolute
reference; just use the absolute section symbol.
(write_relocs): Make printout of reloc values dependent on flag DEBUG3, not
DEBUG2.
* config/obj-aout.h (EMIT_SECTION_SYMBOLS): Define as 0.
* config/obj-ecoff.h (EMIT_SECTION_SYMBOLS): Ditto.
1994-01-28 01:21:53 +00:00
Ken Raeburn
c1b625be7b whitespace/comment changes 1994-01-28 00:21:03 +00:00
Ian Lance Taylor
c6858c1be5 * ecoff.c (ecoff_frob_symbol): New function. Put undefined
symbols of known size in the undefined section.  Put small common
	symbols in a .scommon section.
	* ecoff.h (ecoff_frob_symbol): Declare.
	* config/obj-ecoff.h (obj_frob_symbol): Define.
	* config/obj-elf.c (obj_elf_write_symbol_p, obj_elf_write_symbol,
	obj_elf_frob_symbol): Removed unused functions.
	* config/obj-elf.h (obj_frob_symbol, obj_write_symbol): Removed
	unused macros.
	(obj_elf_frob_symbol, obj_elf_write_symbol): Removed declarations
	of unused functions.
	(obj_frob_symbol): Define if ECOFF_DEBUGGING.
1994-01-25 00:26:33 +00:00
Ian Lance Taylor
425625680a * tc-mips.c (g_switch_seen): New static variable.
(md_parse_option): Set g_switch_seen for -G option.
	(s_option): If creating PIC code, force the GP size to be 0.  Warn
	if -G switch used with a non-zero value.
1994-01-25 00:24:57 +00:00
Ian Lance Taylor
eb8fd0e9b4 * config/tc-mips.c (md_pseudo_table): Add all data allocation
pseudo-ops: .hword, .int, .long, .octa, .quad, .short, .single.
1994-01-20 04:18:14 +00:00
Ian Lance Taylor
13655af625 Smuggle N_WARNING symbols into BFD in obj_aout_frob_symbol. 1994-01-19 05:02:24 +00:00
Jeff Law
2f156c92bd * config/tc-hppa.c: Disable multiple $CODE$ subspace code. It
confuses GDB for some unknown reason.
        * cofnig/obj-som.c: Likewise.
1994-01-19 00:21:16 +00:00
Steve Chamberlain
ec0bcbbaa1 * config/obj-coffbfd.c (obj_coff_endef): For C_EFCN, C_BLOCK and
C_FCN assume .val has been set to .
1994-01-19 00:16:03 +00:00
Ian Lance Taylor
4bda835f61 * config/obj-aout.c (obj_aout_frob_symbol): Try to get symbols
with explicitly marked stabs through BFD: if a symbol marked
	N_UNDF | N_EXT is in the absolute section, move it to the
	undefined section; move a symbol marked N_INDR into
	bfd_ind_section and set the BSF_INDIRECT flag.
1994-01-18 22:27:26 +00:00
Ian Lance Taylor
04cb3372f3 Comment and whitespace changes. 1994-01-17 20:39:26 +00:00
Jeff Law
51517966bc * config/tc-hppa.c (pa_ip): Explicitly check for comma before 'u'
and 'f' template operand.
1994-01-17 09:30:07 +00:00
Jeff Law
d0286a2112 * config/tc-hppa.c (pa_ip): Handle 'N', 'O', 'o', '0', '1', 'u',
and '2' in copr and sfu instruction templates.
1994-01-17 08:19:56 +00:00
David Edelsohn
e79cb10bbe * config/obj-elf.c (obj_elf_section): Fix loop termination test. 1994-01-15 17:31:05 +00:00
Jeff Law
86066d063b * config/obj-som.c (som_frob_file): Call adjust_code_sections
for each section.
        (adjust_code_sections): New function.  Adjusts the VMA for all the
        $CODE$ subspaces.

        * config/tc-hppa.c (md_assemble): Also handle creating a fixup
        for the unwind descriptors if a function's label follows the
        .PROC and .ENTRY directives.
        (pa_entry): Don't set BSF_FUNCTION for the label symbol here; it
        is done elsewhere.  Don't create a fixup for the unwind
        descriptors if the function's label has not been defined yet.
        (pa_proc): For SOM, place each procedure within a new $CODE$
        subspace.  Adjust the segment and frag for the associated
        function label if it exists.
1994-01-13 20:17:39 +00:00
Jeff Law
fca59f9d42 * config/tc-hppa.c (hppa_fix_struct): Add new "segment" field.
(hppa_fix_new): Initialize segment field.
        (md_apply_fix): Do nothing for pc-relative fixup which involves
        crossing a segment boundary.
        (pa_procend): Undefine the current label after handling .PROC
        and .PROCEND directives.
        (dummy_symbol): Make type "symbolS *".  Change references as
        appropriate.
1994-01-13 06:06:35 +00:00
Ian Lance Taylor
f34e27a18a * config/obj-elf.c: If TC_MIPS, include elf/mips.h.
(special_sections): Define.
	(obj_elf_special_section): Get default types and attributes from
	list of special sections.
	* config/tc-mips.c (ELF_TC_SPECIAL_SECTIONS): Define.
1994-01-11 22:35:16 +00:00
Ian Lance Taylor
8197b58995 * config/tc-mips.c (macro): Corrected $at warnings in a couple of
spots.
1994-01-11 19:18:45 +00:00
Ian Lance Taylor
af255ca0bb * listing.c (listing_prev_line): New function.
* listing.c: Include subsegs.h.
	(listing_prev_line): New function.
	(calc_hex): Reset byte_in_frag to zero for each new frag.
	* config/tc-mips.c (append_insn): Call listing_prev_line after
	emitting nop instructions.
	* Makefile.in (listing.o): Depends upon subsegs.h.
1994-01-11 18:06:01 +00:00
Stan Shebs
2a79b2028e Set lose_these_too correctly 1994-01-11 02:55:30 +00:00
Jeff Law
4047ff1d24 * config/tc-hppa.c (pa_ip): Put check for missing label on .PROC
here.  Handle case where label may be defined after the .PROC.
        (pa_proc): It is not an error if the procedure's label isn't
        defined before the .PROC directive.
1994-01-10 17:54:01 +00:00
Ken Raeburn
34e4120b45 keep te-netbsd.h 1994-01-09 21:03:39 +00:00
Ken Raeburn
91176af626 te-netbsd.h: New file.
tc-i386.h (TARGET_FORMAT) [TE_NetBSD]: Use a.out-netbsd-386 for this config.
1994-01-09 20:49:23 +00:00
Stan Shebs
0f8cb88de1 Fri Jan 7 11:18:48 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in: Replace 8-bit chars with their names.
	* config/ho-mpw.h (LOSING_COMPILER): Define.
1994-01-07 19:22:15 +00:00
Stan Shebs
917fae09f9 Fri Jan 7 11:14:07 1994 Stan Shebs (shebs@andros.cygnus.com)
* config/tc-mips.c (macro): Add a LOSING_COMPILER ifdef that
	splits the function.
	(macro2): New function, if LOSING_COMPILER defined.
1994-01-07 19:18:16 +00:00
Steve Chamberlain
03a372ed70 * config/obj-coffbfd.c (fill_section): Don't ever fill past the
end of a section. (write_object_file): Temporary fix - setup
	stdoutput.
1994-01-07 17:42:34 +00:00
Ken Raeburn
fd0e2cf2d5 fix sparc-solaris reloc bug 1994-01-06 23:17:44 +00:00
Ian Lance Taylor
13fe1379a6 * config/tc-mips.c (mips_ip): Warn about using $1 as well as $at
without .set noat.
1994-01-06 06:09:22 +00:00
Ken Raeburn
166d9f909a (TARGET_FORMAT) [OBJ_AOUT]: Fix for new names in bfd. 1994-01-06 01:10:35 +00:00
Rob Savoye
fce98d637f * config/ho-vsta.h, configure.in, .Sanitize: Add support for VSTa
micro-kernel.
1994-01-05 05:26:47 +00:00
Stan Shebs
5a0517735a Tue Jan 4 15:12:43 1994 Stan Shebs (shebs@andros.cygnus.com)
* Makefile.in (INCLUDES): Add $(srcdir)/.. to places to search.
	* config/obj-ecoff.c: Include files as "bfd/" instead of "../bfd/".
	* app.c, flonum.h, hex-value.c (const): Change #if to be more
	portable.
1994-01-04 23:35:56 +00:00
Stan Shebs
4f5d16c7d3 fix the .Sanitize 1994-01-04 21:18:15 +00:00
Stan Shebs
ea838f998a Mon Jan 3 10:47:37 1994 Stan Shebs (shebs@andros.cygnus.com)
* config.sub:	  Add MPW-related aliases.
	* mpw-configure:  New file, MPW version of configure.
	* mpw-config.in:  New file, MPW version of configure.in.
	* mpw-xconfig.in:  New file, addon to configure.in.

Mon Jan  3 12:42:45 1994  Stan Shebs  (shebs@andros.cygnus.com)

	* mpw-xconfig.in: New file, mpw x mips configuration bits.
1994-01-04 21:14:04 +00:00
Ken Raeburn
6868afe647 * as.c (main): Only invoke md_end if it's defined as a macro.
* tc.h (md_end): Don't declare it.
* config/tc-*.[ch] (md_end): Deleted, in cases where it doesn't do anything.
* config/tc-vax.c (vip_end): Deleted null function.
* config/tc-mips.c (md_mips_end): Renamed from md_end.
* config/tc-mips.h (md_mips_end): Declare.
(md_end): New macro, calls md_mips_end.

* write.c (write_object_file): Don't close output file.
* as.c (main): Close output file (if needed) after calling listing_print, which
should be after calling write_object_file, which sets the frag addresses.
1993-12-20 16:48:00 +00:00
Ken Raeburn
7e1766ba87 whitespace 1993-12-20 16:43:37 +00:00
Ken Raeburn
c999fd9fc2 * config/tc-vax.c (tc_aout_fix_to_chars): Local variable NBYTES_R_LENGTH now
const.

* config/obj-*.c, config/tc-*.c: Omit superfluous "return" statements at ends
of functions.  Don't check for null return from hash_new, since it won't return
at all if there's no memory available.  Also, check for null return from
hash_insert, rather than zero-length string, as success indicator.
1993-12-16 21:31:22 +00:00
Jeff Law
551d2fd4cf * config/tc-hppa.c (md_apply_fix): Handle cases where no
relocation will be emitted for 32bit formats.
1993-12-15 05:41:11 +00:00
Jeff Law
9d5a9b20fe * config/tc-hppa.c (md_apply_fix): Do not call hppa_field_adjust
for any of the 'T' field selectors.
1993-12-14 07:34:37 +00:00
Steve Chamberlain
2b5936ff87 * config/tc-h8500.c (build_bytes): Get reloc type right for a
%page operation. (md_assemble): Don't modify input_line_pointer.
	(mdcoff_sizemachdep): New function.
	* config/tc-h8500.h (TC_COFF_SIZEMACHDEP): New macro.
	* config/tc-z8k.c (get_operand): Delete bogus check.
1993-12-11 19:28:41 +00:00
Jeff Law
dd2f509f3d * config/obj-som.[ch] (obj_read_begin_hook): Remove last change.
Breaks with the HP compilers.

        * config/tc-hppa.c (struct call_info): Remove fields which were
        set but never used.  Remove all code which sets those fields.
        (struct subspace_dictionary_chain): Likewise.
        (struct space_dictionary_chain): Likewise.
        (pa_desc): Delete useless function.  Delete all references.
        (hppa_tc_make_sections): No need to count the number of symbols for
        the symbol extension section.
1993-12-06 19:21:51 +00:00
Jeff Law
eb91665b4c * config/obj-som.c (obj_som_version): Pass version string to
SOM BFD backend.
        (obj_som_copyright): New function.  Much like obj_som_version.

        * config/tc-hppa.c (obj_copyright): Define as appropriate for
        SOM and ELF.
        (pa_copyright): Just a stub now.
1993-12-06 08:55:06 +00:00
Jeff Law
42ecb40985 * config/obj-som.c (obj_read_begin_hook): Delete unused function.
* config/obj-som.h (obj_read_begin_hook): Provide dummy definition.
        (TARGET_SYMBOL_FIELDS): Delete.  SOM isn't making use of them.
1993-12-06 07:19:13 +00:00
Jeff Law
4165dcc239 * config/tc-hppa.c (tc_gen_reloc, SOM version): Handle relocation
expansion due to rounding mode selectors.  Handle R_[RDSN]_MODE
        relocations for selecting the current rounding mode.
1993-12-06 03:24:49 +00:00
Jeff Law
7b624bf25c * config/tc-hppa.c (evaluate_absolute): Support e_rrsel and
e_rlsel field selectors.
1993-12-06 01:07:03 +00:00
Jeff Law
753dcbbd0b * config/tc-hppa.c (md_apply_fix): Delete old wrapper function.
(md_apply_fix_1): Rename to md_apply_fix.  Fix argument decls.
	Fix comments in various places.  Always return a value.
	Avoid dereferencing a NULL fx_addsy.
	(hppa_force_relocation): Avoid dereferencing a NULL fx_addsy.
1993-12-03 18:57:28 +00:00
Ken Raeburn
bfbfba45ba Lots of changes for:
- sparc[lite]-coff as well as sparc-lynx
 - producing coff (including debug info) under BFD_ASSEMBLER option
 - cleanup of cpu-specific code in non-cpu-specific files
   (especially write.c)
 - providing common code to avoid duplication in cpu-specific files
   (specifically, md_number_to_chars)
 - stylistic changes & misc cleanup

================

* config/tc-sparc.c (tc_gen_reloc): Make adjustment to addend be dependent on
howto fields, not on format flavour.

* struc-symbol.h (struct symbol): New fields sy_obj and sy_tc, defined as types
OBJ_SYMFIELD_TYPE and TC_SYMFIELD_TYPE, if those macros are defined.
* config/obj-coff.h (TC_SYMFIELD_TYPE, OBJ_SYMFIELD_TYPE): Define.
(TARGET_SYMBOL_FIELDS, I960_SYM_FIELDS): Don't define.
(sy_tc, sy_obj): Define so that the fields look like they used to, until all
references get changed.

* write.c (fixup_segment): Lots of variables no longer register.  Reordered
some code for easier reading.
* config/obj-coff.c (obj_coff_dim): dim_index no longer register.  Deleted
superfluous return statement.
(obj_coff_line, obj_coff_size, obj_coff_scl, obj_coff_type, obj_coff_val,
tag_init, tag_insert): Deleted superfluous return statement.
(align, obj_coff_section): Deleted debugging printfs.
* config/tc-i386.c (md_assemble): Discard some register decls.  Use assignment
rather than memcpy to copy template.
(op_hash, reg_hash, prefix_hash): Default C initialization of statics is
sufficient.
* config/tc-sparc.c (print_insn): Array Reloc is now const, and points to
const.

* config/obj-coff.h (TARGET_FORMAT): Only use coff-sparc-lynx if TE_LYNX; use
coff-sparc otherwise.
[USE_NATIVE_HEADERS]: Delete this code; it isn't used.

* write.c (fixup_segment): Call TC_VALIDATE_FIX, if defined, before processing
a fixup.  Call TC_ADJUST_RELOC_COUNT just before returning.  Remove some
i960-coff-specific code.
(TC_ADJUST_RELOC_COUNT): Default to doing nothing.
* config/tc-i960.h (TC_ADJUST_RELOC_COUNT) [OBJ_COFF]: Define.
(i960_validate_fix): Declare.
(TC_VALIDATE_FIX): Define.
* config/tc-i960.c (i960_validate_fix): New function.

* write.c (number_to_chars_littleendian): New function.  Write out bytes in
little endian order, doing size and range checking.
(number_to_chars_bigendian): New function, similar.
* write.h: Declare them.
* config/tc-*.c (md_number_to_chars): Use them.
* config/tc-vax.c (md_apply_fix): Ditto.
* config/tc-i386.c (md_apply_fix): Ditto.

* config/obj-coff.c: Rearranged code for handling line number data.
(line_fsym): Renamed from function_lineoff in BFD_ASSEMBLER case, since the
usage is different from non-BFD_ASSEMBLER case.
(in_function, clear_function, set_function): New macros, to combine some of the
functionality implemented in differnet ways in BFD_ASSEMBLER and non-... code.
Used in other functions that used to check function_lineoff &c.
(obj_emit_lineno): Split into two copies, one for BFD_ASSEMBLER, one for not.
Non-BFD_ASSEMBLER version now has temporary variable to contain char* pointer
pointed to by char** argument.  Always follow CROSS_COMPILE code; easier to
read that way.
(obj_coff_ln): Don't call add_lineno or c_line_new if appline is set.
(obj_coff_endef) [BFD_ASSEMBLER]: Don't do anything special for ".bf", it's
been done elsewhere.
(coff_frob_symbol): If ilne number data is pending, call add_linesym to flush it.
(coff_frob_file): Don't do that here.
* config/obj-coff.h (coff_frob_file): Declare.
(obj_frob_file): Define, to call it.

* config/tc-sparc.h (md_create_short_jump, md_create_long_jump,
md_estimate_size_before_relax: Define them as macros calling as_fatal.
* config/tc-sparc.c: Don't define them as functions.
1993-12-03 03:10:08 +00:00
Ken Raeburn
2713382f20 include fopen-bin.h 1993-12-01 22:53:14 +00:00
Ian Lance Taylor
4032d3f09e * config/tc-mips.c (macro): From wilson@cygnus.com: for M_L_DAB,
set coproc before doing goto ld.
1993-12-01 19:26:45 +00:00
Jeff Law
44c0de5363 * config/tc-hppa.c (hppa_elf_mark_end_of_function): New function.
(pa_process_exit, pa_procend): Call it for ELF objects.
1993-12-01 18:43:53 +00:00
Ian Lance Taylor
777ad64d69 * config/tc-mips.c (macro): Subtract 8 from offset in non PIC l.d
case.  See comment.
1993-12-01 17:13:12 +00:00
Jeff Law
335d35c8bc * write.c (TC_FORCE_RELOCATION): Provide a default definition.
(fixup_segment): Allow the target machine to specify that a
        relocation must be generated for a particular fixup.  Remove
        #ifndef TC_HPPA hack.

        * config/tc-hppa.h (TC_FORCE_RELOCATION): Define.

        * config/tc-hppa.c (md_apply_fix_1): Never change fx_addsy to
        be NULL.  Only fixup_segment is supposed to do that.
        (hppa_force_relocation): New function.
1993-11-30 21:43:15 +00:00
Jeff Law
81413fa20b * config/tc-hppa.c (fix_new_hppa): Make sure a sub_symbol
exists before trying to peek at its name.
	(pa_space): Do not call pa_align_subseg.  See hppa/unsorted/align3.s
	for testcase.
	(pa_align_subseg): Delete unused/unwanted function.
1993-11-28 20:15:21 +00:00
Jeff Law
d53253d854 * config/tc-hppa.h (LABELS_WITHOUT_COLONS): Define. 1993-11-28 06:54:22 +00:00
Jeff Law
31a385d17a * config/tc-hppa.c (pa_procend): Do not call process_exit.
(exit_processing_complete): Delete unwanted variable and all
        references.
1993-11-24 09:24:39 +00:00
Ian Lance Taylor
c5953036d8 * ecoff.c (ecoff_setup_ext): Renamed from ecoff_build_ext.
Changed to not actually build the external symbol information, as
	that is now done by the ECOFF back end.
	(ecoff_build_debug): Changed accordingly.
	* ecoff.h (obj_ecoff_set_ext): Declare.   obj-format.c function
	called by ecoff_setup_ext.
	* config/obj-ecoff.c (ecoff_frob_file): If debug_info count is 0,
	set corresponding pointer to NULL.  Don't set raw_size and
	raw_syments.
	(obj_ecoff_set_sym_index): Removed.
	(obj_ecoff_set_ext): New function.
	* config/obj-ecoff.h (obj_set_sym_index): Don't define.
	(obj_ecoff_set_sym_index): Don't declare.
	* config/obj-elf.c (obj_ecoff_set_ext, elf_get_extr,
	elf_set_index): New functions used for ECOFF_DEBUGGING.
	(elf_frob_file): Reworked ECOFF debug generation to use
	new functions in bfd/ecofflink.c.
1993-11-24 07:42:03 +00:00
Ian Lance Taylor
e0209756f8 * config/obj-coffbfd.c: Use PARAMS rather than EXFUN.
(yank_symbols): Don't call S_SET_EXTERNAL if the storage class is
	already set.  Fixes .def var; .val external_var; .scl 3; .endef.
	(adjust_stab_section): Make static.  Declare return type.  Remove
	unused variables.

	* config/tc-i386.h: Declare tc_coff_fix2rtype and
	tc_coff_sizemachdep.
1993-11-19 21:37:50 +00:00
Ian Lance Taylor
0dd2d296fc * config/tc-mips.c: Check ECOFF_DEBUGGING rather than
OBJ_ECOFF in many cases.
	(mips_any_noreorder): New variable.
	(mips_cprestore_offset): Initialize to -1.
	(mips_frame_reg): New variable.
	(RELAX_ENCODE, RELAX_OLD, RELAX_NEW, RELAX_RELOC1,
	RELAX_RELOC2, RELAX_RELOC3, RELAX_WARN): New macros.
	(md_pseudo_table): Handle "gpword" and "cpadd".
	(md_begin): Initialize ok to false.  If OBJ_ELF, set alignment
	of text, data and bss sections to 4.  Set alignment of
	.reginfo section to 2.  If ECOFF_DEBUGGING, create .mdebug
	section.
	(ALIGN_ERR, ALIGN_ERR2): Removed unused and useless alignment
	check.
	(append_insn, macro_build, macro_build_lui): Take place
	argument.  Changed all callers.
	(append_insn): If appending a nop, don't emit one.
	(macro_build): Changed assertion for 'i', 'j', 'o' case.
	(gp_reference): Removed.
	(load_address): New function.
	(macro): If mips_noreorder is used, set mips_any_noreorder.
	Extensive changes to handle GP and PIC symbols differently.
	Build both possible code choices using a variant frag, and
	make a final decision at the end of assembly when all
	information is known.  Added PIC support for all symbol
	references.
	(mips_ip): Don't permit anything but a number after $ for a
	coprocessor register.  Don't use .lit4 or .lit8 sections when
	generating PIC code.  If OBJ_ELF, set alignment of .lit4 or
	.lit8 section to 4.
	(md_apply_fix): Accept and ignore GOT16 and GPREL32 relocs.
	(s_change_sec): Set alignment of ELF .rodata or .sdata section
	to 4.
	(s_mipsset): If .set noreorder, set mips_any_noreorder.
	(s_cpload): Ignore .cpload if not generating PIC code.  Warn
	if .cpload is not in noreorder section.
	(s_cprestore): Ignore .cprestore if not generating PIC code.
	(s_gpword, s_cpadd): New functions.
	(tc_get_register): Added frame argument; if true, set
	mips_frame_reg to return value.  Changed all callers.
	(md_estimate_size_before_relax): Don't error out, but instead
	determine how much a frag should grow.
	(tc_gen_reloc): Return multiple relocs if appropriate, as
	determined by md_estimate_size_before_relax.
	(md_convert_frag): New function.
	(mips_elf_final_processing): Set ELF header flags based on
	mips_any_noreorder and mips_pic.
	* config/tc-mips.h (RELOC_EXPANSION_POSSIBLE): Define.
	(MAX_RELOC_EXPANSION): Define to be 3.
	(md_relax_frag): Define to be 0.
	(md_convert_frag): Don't define.
	(tc_get_register): Changed declaration.
1993-11-18 18:56:31 +00:00
Jeff Law
c5e9ccd030 * config/tc-hppa.c (pa_ip): Fix thinko in 21bit range check. 1993-11-17 04:40:15 +00:00
Jeff Law
f2eed8840d * config/tc-hppa.c (hppa_fix_struct): Use a real type for the
field selector, rather than an int.  All uses of field selectors
	fixed.
	(tc_gen_reloc): For SOM PLABELs, always set addend to zero for now.
	(md_apply_fix_1): Do not call hppa_field_adjust for any PLABEL
	field.
1993-11-12 22:54:41 +00:00
Jeff Law
a721c80b05 * config/tc-hppa.c (pa_type_args): For .import statements,
silently ignore attempt to change the symbol type for a function
        from ST_ENTRY to ST_CODE on .import
1993-11-11 23:51:20 +00:00
Ian Lance Taylor
ca16b5e55a * write.h (fixS): Rename fx_callj field to fx_tcbit.
* write.c, config/obj-coff.c, config/obj-coffbfd.c,
	config/tc-i960.c: Corresponding changes.
1993-11-10 22:06:06 +00:00
Jeff Law
f41f3d72ec * config/tc-hppa.c (evaluate_absolute): Avoid relying on
ANSI-C features.
1993-11-09 09:52:59 +00:00
Jeff Law
48153d49ce * config/tc-hppa.c (pa_type_args): Renamed from pa_export_args.
Accept new argument "is_export".  All callers changed.  When
        processing a .export directive for a function, do not allow
        the user to set the type to "CODE", instead warn and set the
        type to "ENTRY".
1993-11-09 08:51:02 +00:00
Ian Lance Taylor
9226253a41 * config/tc-mips.c (mips_ip, printInsn): Handle 'k' (from Ted
Lemon <mellon@pepper.ncd.com>).
	(mips_ip): Permit odd numbered floating point registers if -mips3.
1993-11-08 17:09:18 +00:00
Jeff Law
2598939269 * config/tc-hppa.h (SEG_DIFF_ALLOWED): Delete definition.
* config/tc-hppa.c (fix_new_hppa): If the subtract symbol for
        a fixup is $global$ change it to NULL as $global$ is really only
        needed long enough to determine the base type of relocation to use.
1993-11-07 20:07:51 +00:00
Jeff Law
240cbc571f * config/tc-hppa.c (create_new_subspace): Initialize subspace_defined. 1993-11-07 09:15:13 +00:00
Jeff Law
163aac84be * config/tc-hppa.c (pa-ip, case 'z'): Make field selectors work
for 'z' operands (target of ble branch).
1993-11-07 09:03:59 +00:00
Jeff Law
18c4f112b4 * config/tc-hppa.c: (update_subspace): Fix type and name of last
parameter.  All callers fixed.
        (md_begin, pa_chk_field_selector, pa_entry): Lint.
1993-11-07 07:23:52 +00:00
Jeff Law
1cc248d263 * config/tc-hppa.c (cons_fix_new_hppa): Reset field selector
to default state after it's been used.
1993-11-07 06:43:24 +00:00
Jeff Law
d6e524f308 * tc-hppa.c: Add %dp and %rp as synonyms for %r27 and %r2 in the
predefined register table.
	(pa_parse_number): Handle %rp in common register shortcut code.
	Consistently set return value to -1 for an error.  Clean up error
	messages and only print them when "print_errors" is true.  Handle
	empty string case like the HP assembler -- assume a value of
	zero.
1993-11-03 06:21:14 +00:00
Jeff Law
5d5a6520c3 * config/ho-hpux.h: Do not include ho-sysv.h. Instead include
standard hpux include files to pick up various function decls.
1993-11-02 23:38:41 +00:00
Jeff Law
a50cf51f2e * config/ho-hppaosf.h: Delete _IO* macros. They are defined in
stdio.h.  Delete bogus declaration of free.  Get path to
	alloca-conf.h right.
1993-11-02 23:07:00 +00:00
Jeff Law
ff852e1177 * config/obj-som.h (obj_attach_unwind_info): Define as a hook
so GAS can attach unwind descriptor information to a BFD symbol.
	* config/tc-hppa.c (fix_new_hppa): If necessary attach unwind
	descriptor information to the BFD symbol.
	(md_apply_fix): R_HPPA_ENTRY and R_HPPA_EXIT can never be "applied",
	they are simply markers.  Make R_HPPA_UNWIND_* handling OBJ_ELF
	dependent.
	(pa_build_unwind_subspace): Whole function is OBJ_ELF dependent.
	(pa_entry): Build a R_HPPA_ENTRY relocation when configured for SOM.
	(pa_exit): Likewise, but built a R_HPPA_EXIT relocation.  Do not
	build "end-of-function" symbols for SOM, they are not needed.
1993-11-02 08:06:23 +00:00
Jeff Law
a50e9b5506 * config/tc-hppa.c (process_exit): Create temporary symbols with
correct prefixes so they can be eliminated later.
1993-11-02 06:43:11 +00:00
Jeff Law
49fc68a13f * config/tc-hppa.c (call_info struct): Delete unused "frame" field.
(pa_callinfo): Insert framesize into the unwind information as
	soon as it's available.
	(pa_build_unwind_subspace): Do not insert framesize into the unwind
	information here.
1993-11-02 06:38:20 +00:00
Jeff Law
f197d7eb66 * config/obj-som.h (obj_frob_file): Define.
* config/obj-som.c (obj_som_init_stab_section): Set alignment
	of stab sections.  Make space for the special stab entry.
	(adjust_stab_sections): Adjust the special entry in the
	stabs section.
	(som_frob_file): New function.  Simply calls adjust_stab_sections
	for each section.
1993-11-02 05:37:58 +00:00
Jeff Law
47f45d6636 * config/tc-hppa.c (subspace_dictionary_chain): Add new ssd_defined
field.  Define SUBSPACE_DEFINED accessor macro.
	(pa_subspace): Allow user to override subspace attributes for
	built-in subspaces.  Set ssd_defined at the end of fcn -- that
	way the attributes can only be changed once.  Pass newly allocated
	name to is_defined_subspace, not a pointer to the input line.
	Fix typo in space/subspace rework.
	(is_defined_subspace): Delete unused 2nd arg.  All callers changed.

	* config/tc-hppa.c (pa_import): If currently in the text segment
	and a symbol is imported without type information, set BSF_FUNCTION
	for the symbol.
1993-10-31 18:49:26 +00:00
Jeff Law
e75acd689b * config/obj-som.h (obj_set_symbol_type): Define a hook so GAS
can properly set all the SOM symbol types.
	* config/tc-hppa.c (pa_symbol_type): New enum to represent the
	symbol types which can be set from an IMPORT/EXPORT statement.
	(pa_export_args): Set the pa_symbol_type type based on arguments.
	If defined, call obj_set_symbol_type to pass this information on
	to the BFD backend.
1993-10-31 07:48:41 +00:00
Jeff Law
b309df49dc * config/tc-i386.h (DOT_LABEL_PREFIX): Delete.
(LOCAL_LABEL, FAKE_LABEL_NAME): Define.
        * config/tc-m68k.h (DOT_LABEL_PREFIX): Delete.
        (LOCAL_LABEL, FAKE_LABEL_NAME): Define.
        * config/te-sco386.h (DOT_LABEL_PREFIX): Delete.
        (LOCAL_LABEL, FAKE_LABEL_NAME): Define.
1993-10-31 02:18:17 +00:00
Jeff Law
b89094aa91 * config/tc-hppa.h (FAKE_LABEL_NAME): Define as L$0\001 so it's
known to be a local label.
1993-10-31 02:13:49 +00:00
Jeff Law
3b9a72c53c Rework space/subspace handling in PA code to fully support
SOM spaces/subspaces.
	* config/tc-hppa.c (USE_ALIASES): New object-format dependent define
	to control the use of space/subspace name aliases.
	(update_subspace): Accept space chain entry for containing space
	as a new parameter.  All callers changed.
	(pa_get_label): Use current_space rather than pa_segment_to_space.
	(pa_define_label): Likewise.
	(pa_undefine_label): Likewise.
	(md_begin): Change into the (possibly modified) text_section.
	(pa_parse_space_stmt): Create a new segment/space if create_flag
	is true, and the space name is not one of the two predefined spaces.
	(pa_subspace): Use current_space rather than a lookup via
	pa_segment_to_space.  Reset BFD section flags as required by
	the .subspace directive.  Likewise for the section alignment.
	Pass the current space to update_subspace and create_new_subspace.
	(pa_spaces_begin): Only use space/subspace aliases if USE_ALIASES
	is true.  When not using aliases, create a BFD section for each
	subspace encountered.  When not using aliases replace the default
	text, data, and bss segments with new ones.
	(create_new_subspace): When not using aliases each subspace has a
	section/segment and subsegments are not needed, so set the subsegment
	to zero.
1993-10-31 01:53:01 +00:00
Jeff Law
548ea75baa * config/tc-hppa.c (pa_parse_space_stmt): If needed, call
obj_set_section_attributes to pass space attributes to the
        BFD backend.
        (create_new_space): Likewise.
        (create_new_subspace): Likewise for subspace attributes using
        obj_set_subsection_attributes.
        (update_subspace): Likewise for subspace attributes using
        obj_set_subsection_attributes.
1993-10-30 23:11:31 +00:00
Jeff Law
0f3b419c4c * config/tc-hppa.c (pa_parse_space_stmt): Get segment and sort key
for $TEXT$ and $PRIVATE$ from the default space structure.
1993-10-30 23:00:34 +00:00
Jeff Law
9a182533aa * config/tc-hppa.c (pa_export_args): Always set BSF_FUNCTION
as appropriate for the given type.
1993-10-30 22:55:19 +00:00
Jeff Law
62f0841b9d * config/tc-hppa.c (tc_gen_reloc): Preliminary stab at handling
SOM relocations.
1993-10-30 22:35:49 +00:00
Jeff Law
d56f45f5bc * config/tc-hppa.c (pa_comm): Delete incorrect check for symbol
redefinition.
1993-10-30 22:02:53 +00:00
Jeff Law
0fa747c4f3 * config/obj-som.[ch]: New files for SOM support in GAS. 1993-10-30 21:55:00 +00:00
Jeff Law
12696e9cb5 * config/ho-hppabsd.h: Delete IO* macros, they are defined in
stdio.h.  Delete declaration of free.  Include stdlib.h, unistd.h,
        and string.h.
1993-10-30 21:29:29 +00:00
Jeff Law
b89b288031 * config/obj-coffbfd.c (obj_coff_init_stab_section): Append "str"
to stab section name to get the stab string section name.  Pass
        the full name of the stab string section to get_stab_string_offset.
        * config/obj-elf.c (obj_elf_init_stab_section): Likewise.
1993-10-30 07:15:46 +00:00
Jeff Law
13925cef35 * config/tc-hppa.c (md_begin): Disable "-R" option to fold
text and data segments.  Warn user "-R" is unsupported on the
        PA.
1993-10-29 21:09:43 +00:00
Jeff Law
2b151da9aa * config/tc-hppa.h (NO_FOLD_DATA_AND_TEXT): Define. Folding
of text and data segments fails miserably on the PA.
1993-10-29 20:35:44 +00:00
Jeff Law
d33ace2e25 * config/tc-hppa.c (md_pseudo_table): Default alignment is 8 for
.align and .ALIGN directives.
1993-10-29 01:01:35 +00:00
Jeff Law
3515a504aa * config/tc-hppa.c (pa_parse_space_stmt): Advance
input_line_pointer when an invalid argument is encountered.
1993-10-28 23:14:33 +00:00
Jeff Law
00f6df56f6 Merge with current Utah code:
* config/tc-hppa.h (tc_fix_adjustable): Call hppa_fix_adjustable to
        perform the real work.

        * config/tc-hppa.h (RELOC_EXPANSION_POSSIBLE): Move definition out
        of OBJ_XXX conditionals.
        (MAX_RELOC_EXPANSION): Likewise.
1993-10-28 20:43:13 +00:00
Jeff Law
aa8b30edeb Merge with current Utah code:
* config/tc-hppa.c (pa_space): Do not report an error for a .space
        directive which does not define a "well-known" space and does
        not include a space number as an argument.

        * config/tc-hppa.c (pa_def_subspaces): Correct initialization of the
        "defined", "loadable", "code_only" and "space_index" fields.
        (pa_def_spaces): Correct initialization of the "spnum", "defined",
        and "private" fields.

	* config/tc-hppa.c (hppa_fix_struct): Delete unnecessary fix_fixP and
        fx_next fields.
        (hppa_find_hppa_fix): Delete unnecessary function.  Fix all
        callers to get HPPA fixup information from the tc_fix_data field
        in the GAS fixup.
        (hppa_fix_root): Delete unnecessary variable.
        (fix_new_hppa): Attach HPPA fixup data to the GAS fixup.

        * config/tc-hppa.c (pa_set_start_symbol); Delete unwanted
        function.  Fix all callers.
        (subspace_dictionary_chain): Delete unused ssd_start_sym field.

        * config/tc-hppa.c (hppa_fix_adjustable): New function to determine
        if a particular fixup is adjustable.

        * config/tc-hppa.c (log2): Renamed from is_power_of_2.  Fix all
        callers. Now returns log2 (N) for positive N which are an exact
        power of two or -1 for an error.

        * config/tc-hppa.c (pa_callinfo): Range check values provided for
        ENTRY_GR, ENTRY_FR and ENTRY_SR.  Properly adjust vaues before
        inserting them into the unwind table.

        * config/tc-hppa.c (NEEDS_FIXUP): Delete definition and all references.
        (hppa_gen_reloc_type): New object format dependent macro.
        (pa_ip): Delete tons of code which was either OBJ_SOM or OBJ_ELF
        conditional.  The code can (and will) be shared between SOM & ELF
        formats in the near future.
        (cons_fix_new_hppa, md_apply_fix_1): Likewise.
        (pa_build_unwind_subspace, process_exit, pa_exit): Likewise.
        (tc_gen_reloc): Use hppa_gen_reloc rather than an object format
        specific call.

        * config/tc-hppa.c (pa_comm): Set the segment for a common symbol
        to bfd_und_section.

        * config/tc-hppa.c (pa_big_cons): Delete function and its
        declaration.  All callers changed to use pa_cons.

        From Pete Hoogenboom:
        * config/tc-hppa.c (md_atof): Return a NULL on success rather than
        an empty string.
1993-10-28 20:41:49 +00:00
Ian Lance Taylor
6121fb06ad * config/tc-a29k.c (md_begin): When opcodes are mashed together in
the table, require that the one without bit 0x1000000 set come
	first.  Require further that it be case 'b' or 'P'.  The a29k
	opcode table already meets these constraints.
	(machine_ip): When handling case 'i' or 'A', make sure that the
	appropriate opcode really exists by looking at the next entry in
	the opcode table.
1993-10-28 17:14:16 +00:00
Ian Lance Taylor
56c96faae6 * config/tc-mips.c (macro_build): Handle '>' case (shift amount
between 32 and 63 for double shift instruction).
	(mips_ip): Likewise.
	(printInsn): Likewise.
1993-10-27 15:52:03 +00:00
Ian Lance Taylor
f3751617c3 * config/tc-m68k.c (md_apply_fix_2): Error if a short branch uses
an illegal offset of 0 or -1.
1993-10-26 21:58:41 +00:00
Ian Lance Taylor
fa20b8bfd5 * config/obj-elf.c (obj_elf_init_stab_section): Align .stab
section to a longword boundary.
1993-10-26 21:01:15 +00:00
Ken Raeburn
535721d5f0 Show full pathnames.
For "safe" case, move tc-sparc64 files into .Recover, instead of deleting them.
1993-10-26 17:29:39 +00:00
Ken Raeburn
8f78d0e9dc (tc_gen_reloc): ELF32_HPPA_R_ADDEND -> HPPA_R_ADDEND. 1993-10-26 17:26:23 +00:00
Ian Lance Taylor
9b2fd75ba1 * config/tc-sparc.c (sparc_ip): Use strtol to parse membar
argument, to permit hexadecimal numbers.
1993-10-25 18:08:33 +00:00
Ken Raeburn
9b6a882eeb * config/tc-sparc.h: Removed remaining non-BFD_ASSEMBLER code.
* config/tc-sparc.c: Ditto.
(tc_gen_reloc): Include fx_offset for pcrel fixups.
1993-10-25 17:45:17 +00:00
Jim Wilson
52aa70b52d Add support for .dword pseudo op to mips port. 1993-10-24 23:52:09 +00:00
Ian Lance Taylor
8efed14f10 * input-scrub.c (physical_input_file, logical_input_file,
physical_input_line, logical_input_line): Made static.
	(as_where): Return current file name and line number, don't print
	them out.
	* messages.c (as_show_where): New static function.  Other
	functions use it instead of as_where.
	(as_bad_internal): New static function.
	(as_bad): Use as_bad_internal.
	(as_bad_where): New function, like as_bad but taking a file name
	and line number.
	* as.h (as_bad_where): Declare.
	(as_where): Change prototype for new arguments.
	* write.h (fixS): Added fields fx_file and fx_line.
	* write.c (fix_new_internal): Save file and line number in fix.
	(fixup_segment): Use as_bad_where, not as_bad.
	* input-file.c (f_in, file_name): Made static.
	* cond.c (struct file_line): Just use file and line fields.
	(s_else): Use as_where and as_bad_where, not get_file_line and
	set_file_line.
	(get_file_line, set_file_line): Removed.
	* listing.c (listing_newline): Use as_where.
	* config/obj-coffbfd.c (obj_coff_init_stab_section): Use as_where.
	* config/obj-ecoff.c (add_file): Use as_where.
	* config/obj-elf.c (obj_elf_init_stab_section): Use as_where.
	* config/tc-m68k.c (md_apply_fix_2): Use as_bad_where.
	* config/tc-mips.c (tc_gen_reloc): Use as_bad_where, not assert.
1993-10-22 19:15:20 +00:00
Ken Raeburn
2d4f509a1f delete some code in "#if 0" 1993-10-21 19:55:01 +00:00
Ian Lance Taylor
7766838e96 * config/tc-sparc.c (md_parse_option): Accept and ignore -sparc
option, which is used by the SunOS make default .s.o rule.
1993-10-21 19:50:57 +00:00
Ian Lance Taylor
dff60b7d48 * config/tc-m68k.h (AOUT_MACHTYPE): Define to be external variable
m68k_aout_machtype.
	* config/tc-m68k.c (omagic): Remove obsolete and unused variable.
	(m68k_aout_machtype): New variable, if OBJ_AOUT.
	(md_assemble): Initialize m68k_aout_machtype based on
	current_architecture, if OBJ_AOUT.
	(md_parse_option): Remove obsolete reference to omagic.
1993-10-19 22:18:15 +00:00
Ian Lance Taylor
dd3f1f765f * config/tc-mips.c (md_pseudo_table): Ignore .livereg pseudo-op.
(s_option): Ignore .option O* and .option pic*.
	(s_ent): Skip whitespace between symbol and optional digit.
1993-10-14 21:06:52 +00:00
Ian Lance Taylor
ad660eb164 Thu Oct 14 11:33:25 1993 Michael Meissner (meissner@osf.org)
* config/tc-i386.c: (md_begin): Do not zero static arrays.  Don't
	call strchr for each character to see if it is a special char,
	instead add a second loop over special_chars.  Set alignment
	of text, data and bss sections to 4.
	(pi, te, pt, pe, ps): Add declarations so that DEBUG386 can be
	used again.
	(reloc): Don't return 8 and 16 bit non-PC relative relocations on
	ELF, since the ELF object format does not have these type of
	relocations.  Change the abort into as as_bad and return
	BFD_RELOC_NONE to silence compiler warnings.
	(md_assemble): Keep track of the instruction size.  Allow white
	space between the $ and the constant for compatibility with older
	gases and other assemblers.
	(i386_operand): Skip spaces between $ and expression.
	(tc_gen_reloc): Don't allow anything but 32 bit relocations on
	ELF.  Convert abort into an as_bad and assert into as_fatal.
1993-10-14 15:41:52 +00:00
Ken Raeburn
56f61233b2 * config/obj-coffbfd.c (fixup_segment) [DIFF_EXPR_OK]: If
sub_symbolP is in the current segment, convert to a PC-relative
	fixup and discard the symbol.
(Copied from write.c.)
1993-10-13 20:54:03 +00:00
Ian Lance Taylor
f2a663d3a3 * config/tc-mips.c: If OBJ_ELF, include elf/mips.h.
(mips_regmask_frag): New static variable, if OBJ_ELF.
	(md_begin): If OBJ_ELF, create .reginfo section and set
	mips_regmask_frag to a frag.
	(mips_elf_final_processing): New function, if OBJ_ELF.  Set
	mips_regmask_frag to register mask information.
	* config/tc-mips.h (elf_tc_final_processing): New macro, defined
	if OBJ_ELF.
1993-10-12 21:31:29 +00:00
Ken Raeburn
9902404797 more null/empty string fixups 1993-10-12 08:45:49 +00:00
Ian Lance Taylor
f37449aaf3 * write.c (write_contents): Don't crash if seginfo is NULL.
* config/obj-ecoff.c (ecoff_frob_file): Write out register masks
	by modifying .reginfo section, not by directly modifying BFD
	backend data.
1993-10-11 21:40:10 +00:00
David D. Zuhn
fec552ce18 remove extern time() decl 1993-10-11 21:12:37 +00:00
Ian Lance Taylor
1aa6938eb3 * config/tc-mips.c (mips_gprmask, mips_cprmask): New variables to
hold register masks.
	(md_begin): Initialize them to zero.
	(append_insn): Update mips_gprmask and mips_cprmask.  Also add
	register variables pinfo and prev_pinfo.
	* config/tc-mips.h (mips_gprmask, mips_cprmask): Declare.
	* config/obj-ecoff.c (ecoff_frob_file): If TC_MIPS, set gprmask
	and cprmask from mips_gprmask and mips_cprmask.
1993-10-08 20:01:10 +00:00
Ian Lance Taylor
8822543394 * config/tc-mips.h: Define TARGET_FORMAT if OBJ_ELF.
* config/tc-mips.c (GPOPT): Define if OBJ_ECOFF or OBJ_ELF.
	(various): Change all references to GP references to apply if
	GPOPT, not if OBJ_ECOFF.
	(s_change_sec): Rearrange somewhat.  If OBJ_ELF, use .rodata
	instead of .rdata.  If OBJ_ELF, set section flags for .rodata and
	.sdata sections.
	(s_frame, s_loc, s_mask): Comment out entire functions, rather
	than just body.  They're not used anyhow.
	* configure.in: Set cpu_type to mips for mips*.  Accept
	mips-*-elfl* and mips-*-elf*.
1993-10-08 18:24:41 +00:00
Ian Lance Taylor
abdad6bc5f * config/tc-mips.c (cons_fix_new_mips): New function. Turn
BFD_RELOC_64 into BFD_RELOC_32.
	* config/tc-mips.h (TC_CONS_FIX_NEW): Define.
	(cons_fix_new_mips): Declare.
1993-10-06 18:36:20 +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
K. Richard Pixley
6cc87fbb75 correct a few mistakes found while extending the dissassembler. 1993-09-29 23:18:06 +00:00
Stan Shebs
d0c25cae81 Keep te-lynx.h 1993-09-28 20:20:27 +00:00
Stan Shebs
8f3956b328 More Lynx support, plus better stabs-in-coff generation. 1993-09-28 19:22:08 +00:00
Ken Raeburn
43029a8f84 Whitespace/comment cleanup. Use PARAMS in tc-vax.c.
Make various routines return null pointer instead of empty string for
success indication.
1993-09-28 04:47:32 +00:00
Ken Raeburn
e3fce8d283 define DIFF_EXPR_OK 1993-09-27 03:56:04 +00:00
Ken Raeburn
b80d39a01c (flag_want_pic): New variable, mostly ignored.
(md_parse_option) [TE_SUN3]: Set it for "-k".
(m68k_ip): Generate proper fixup for mode 7.3.
1993-09-27 03:55:33 +00:00
Ken Raeburn
bcb8dff8d8 Moved struct m68k_incant and related macros earlier in the file.
Make insop and add_exp functions for readability.
Whitespace/comment changes.
1993-09-25 09:32:12 +00:00
K. Richard Pixley
58f3e8a9db * config/tc-m88k.c (get_o6): new function.
(get_bf, get_cmp, get_cnd, get_cr, get_fcr, get_imm16, get_reg,
	  get_vec9, getval, get_pcr, calcop, match_name): make static and
	  prototype.
	  (s_file): remove extraneous forward decl.
	  (md_begin): add const to retval decl.
	  (calcop): cope with instructions without arguments.  Handle 'o'
	  type argument, the o6 field of the prot insn.
	  (md_estimate_size_before_relax): return a dummy value.
1993-09-24 19:47:59 +00:00
K. Richard Pixley
6d6b97b749 * config/m88k-opcode.h (m88k_opcodes): comment change; o6 field is
in bits 10 through 7.  flt.[dxs]s requires an r register in the
	  second argument.  New instruction lda.x.  New instruction muls
	  (alias for mul).
1993-09-24 19:41:51 +00:00