aboutsummaryrefslogtreecommitdiff
path: root/gas/write.c
AgeCommit message (Collapse)AuthorFilesLines
1997-10-19 * write.c (subsegs_finish): New function, broken out ofIan Lance Taylor1-39/+78
write_object_file. (write_object_file): Some code moves into subsegs_finish. * write.c (subsegs_finish): Declare. * as.c (main): Call subsegs_finish. Fixes last frag when generating a listing for a file with an error.
1997-06-12 * write.c (write_object_file): In non BFD_ASSEMBLER code, as weIan Lance Taylor1-2/+8
step through the frags calling cvt_frag_to_fill, switch to SEG_DATA when we reach data_frag_root. PR 12580.
1997-04-05 * config/tc-m32r.[ch]: New files.David Edelsohn1-7/+28
* cgen.c: New file. * Makefile.in (CPU_TYPES): Add m32r. (CFILES): Add cgen.c. (TARGET_CPU_CFILES): Add tc-m32r.c. (TARGET_CPU_HFILES): Add tc-m32r.h. (OBJS): Add cgen.o. (DISTCLEAN_HERE): Add cgen-opc.h. (.dep1,.tcdep): Create empty cgen-opc.h. (cgen.o): Add dependencies. (dependencies): Regenerate. * as.h (struct frag): New member fr_targ. (fr_pcrel_adjust,fr_bsr): Move into union fr_targ.ns32k. * conf.in (USING_CGEN): New macro. * configure.in (m32r-*-*): Add entry for. * configure: Regenerate. * write.c (relax_frag): fr_pcrel_adjust renamed to fr_targ.ns32k.pcrel_adjust. * config/tc-ns32k.c (*): Likewise. fr_bsr renamed to fr_targ.ns32k.bsr.
1997-03-18fix last patchIan Lance Taylor1-1/+1
1997-03-17 * as.h (bfd_alloc_by_size_t): Don't declare.Ian Lance Taylor1-18/+33
* Many files: Use xmalloc rather than bfd_alloc_by_size_t.
1997-02-03 * symbols.c (resolve_symbol_value): Don't change X_add_number forIan Lance Taylor1-1/+11
an equated symbol. * write.c (write_relocs): Avoid looping on equated symbols. Adjust fx_offset by X_add_number for each symbol. * config/obj-coff.c (do_relocs_for): Avoid looping on equated symbols. (fixup_segment): Add a loop to track down equated symbols and adjust fx_offset appropriately.
1997-01-31 * write.c (relax_segment): Give an error if a .space symbol isIan Lance Taylor1-2/+5
common or undefined. * read.c (read_a_source_file): Don't handle mri_pending_align if the handler is s_globl or s_ignore.
1997-01-22 Patch presumed to have been checked in awhile ago but wasn't.David Edelsohn1-131/+147
Mon Nov 25 10:45:14 1996 Doug Evans <dje@seba.cygnus.com> * write.c: Delete "ifndef md_relax_frag" around is_dnrange. (relax_segment, case rs_org): Move code inside braces. Move locals target,after inside too. (relax_segment, case rs_machine_dependent): Guts moved to ... (relax_frag): New function. Call md_prepare_relax_scan if defined.
1997-01-03 * config/tc-m68k.c (m68k_ip): Accept 'B' as a size for anIan Lance Taylor1-3/+9
immediate value. (md_assemble): If the size is 'B', set fx_signed. (md_apply_fix_2): Use fx_signed when checking for overflow. * write.h (struct fix): Add fx_signed field. * write.c (fix_new_internal): Initialize fx_no_overflow and fx_signed fields. (fixup_segment): Use fx_signed when checking for overflow. * config/obj-coff.c (fixup_segment): Check fx_no_overflow and fx_signed when checking for overflow.
1996-12-19 * write.c (adjust_reloc_syms): If the fixup symbol has beenIan Lance Taylor1-22/+12
equated to an undefined symbol, convert the fixup to being against the target symbol. Remove obsolete code handling a special case for i386 PIC.
1996-12-15 * write.c (adjust_reloc_syms): Fix linkonce check for ELF.Ian Lance Taylor1-9/+25
1996-12-13 * write.c (adjust_reloc_syms): Don't reduce a reloc against aIan Lance Taylor1-0/+18
linkonce section into a reloc against the section symbol.
1996-12-12 * write.c (adjust_reloc_syms): Make sure that symbols areIan Lance Taylor1-1/+11
resolved; expression symbols may have been skipped. PR 11240.
1996-12-05 * write.c (fixup_segment): Don't discard the symbol for a PCIan Lance Taylor1-2/+10
relative fixup to an absolute symbol. PR 11204.
1996-10-14Mon Oct 14 11:24:28 1996 Richard Henderson <rth@tamu.edu>Ian Lance Taylor1-16/+38
* config/obj-elf.c (elf_frob_file): Move ECOFF debug processing to ... (elf_frob_file_after_relocs): ... here. New function. * config/obj-elf.h (obj_from_file_after_relocs): New macro. * write.c (write_object_file): Call *frob_after_relocs after the call to write_relocs. * config/tc-alpha.c: Use new BFD_RELOC_ALPHA_ELF_LITERAL reloc. * config/tc-alpha.c (load_expression): Don't SET_VALUE on the section symbol, as this messes up linking. Instead, expand the recursive call inline and change up the appropriate bits to get the 0x8000 offset in the reloc addend.
1996-06-20 * write.c (is_dnrange): Only define if TC_GENERIC_RELAX_TABLE isIan Lance Taylor1-0/+2
defined.
1996-06-19 * as.c (emulation_name): Remove unused static variable.Ian Lance Taylor1-3/+19
(default_emul_bfd_name): Add return NULL to avoid warning. * ecoff.c (ecoff_stab): Remove unused variables name and name_end. * frags.c (frag_new): Remove unused variable tmp. * hash.c (hash_grow): Parenthesize + within <<. (hash_print_statistics): Use %lu, not %d, to print unsigned long variables. * messages.c: Include "libiberty.h". (fprint_value): Add cast to avoid printf warning. (sprint_value): Likewise. * read.c: Include "ecoff.h". (emit_expr): Add casts to avoid printf warnings. * read.h: Use extern for function declarations. (pop_insert): Declare. * stabs.c: Include "ecoff.h". * subsegs.c (subseg_set_rest): Remove unused variables tmp, former_last_fragP, and new_fragP. * subsegs.h (subsegs_print_statistics): Declare. * symbols.c (debug_verify_symchain): Change macro to discard arguments. * write.c (dump_section_relocs): Likewise. * write.h: Use extern for function declarations. (write_print_statistics): Declare. * config/e-mipsecoff.c (mipsecoff_bfd_name): Return NULL to avoid warning. * config/e-mipself.c (mipself_bfd_name): Likewise. * config/obj-elf.h (elf_ecoff_set_ext): Declare.
1996-02-12Mon Feb 12 15:16:29 1996 Andreas Schwab ↵Ian Lance Taylor1-1/+48
<schwab@issan.informatik.uni-dortmund.de> Support for OBJ_ELF on m68k, mostly inside #ifdef OBJ_ELF: * config/m68k-parse.h (enum pic_relocation): Define. (struct m68k_exp): Add pic_reloc field. * config/tc-m68k.h (TC_RELOC_RTSYM_LOC_FIXUP): Define. (tc_fix_adjustable): Define to call tc_m68k_fix_adjustable. (NO_RELOC): Define to BFD_RELOC_NONE if BFD_ASSEMBLER, to zero otherwise. * config/tc-m68k.c: Delete definition of NO_RELOC. (struct m68k_it): Add pic_reloc field. (add_fix): Copy over pic_reloc field. (md_pseudo_table): Interpret .align parameter as byte count. (mote_pseudo_table): Likewise. (tc_m68k_fix_adjustable): New function. (get_reloc_code): New function. (md_assemble): Use it as last argument to fix_new_exp. (md_apply_fix_2): For a relocation against a symbol don't put the addend into the data. (tc_gen_reloc): Different addend computation for OBJ_ELF. (m68k_ip): Don't relax an operand that requires pic relocation. (md_begin): Align .text, .data and .bss on 4 byte boundary by default. * write.c (fixup_segment): Don't add symbol value to addend if TC_M68K and OBJ_ELF. * config/m68k-parse.y (yylex): Handle @PLTPC, etc. (motorola_operand): Add rule for `(zapc, EXPR)'.
1995-10-24Fix PR 8255Michael Meissner1-11/+44
1995-09-13 * write.c (relax_and_size_seg): Change to the segment we areIan Lance Taylor1-4/+11
relaxing, in case md_convert_frag, called by cvt_frag_to_fill, wants to call fix_new. * config/tc-m68k.c (m68k_ip): Permit PC relative code if the segment of the symbol is the current segment, not just in text_section. (md_convert_frag_1): Don't call subseg_change. (md_estimate_size_before_relax): Likewise.
1995-08-31Thu Aug 31 16:41:06 1995 steve chamberlain <sac@slash.cygnus.com>Steve Chamberlain1-58/+49
* write.c (fixup_segment): Remove change of 29th. * config/tc-{i386,arm}.h (TC_FORCE_RELOCATION): Keep RVA relocs.
1995-08-13 * frags.c (frag_align): Handle absolute_section.Ian Lance Taylor1-0/+2
* write.c (record_alignment): Likewise.
1995-08-11Allow large addends for BFD_RELOC_{LO16,HI16,HI16_S} relocs.Michael Meissner1-1/+1
1995-08-09 * write.c (adjust_reloc_syms): Check that symbol is not NULLIan Lance Taylor1-2/+3
before checking sy_mri_common. (fixup_segment): Likewise. * config/obj-coff.c (fixup_segment): Likewise.
1995-08-08 * struc-symbol.h (struct symbol): Add sy_mri_common bit.Ian Lance Taylor1-0/+23
* 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* write.c (relax_align): Add extra padding for linkrelax only ifKen Raeburn1-3/+22
LINKER_RELAXING_SHRINKS_ONLY is defined. * config/tc-i960.h (LINKER_RELAXING_SHRINKS_ONLY): Define it. * doc/internals.texi (Relaxation): Write up some stuff on linker relaxing and LINKER_RELAXING_SHRINKS_ONLY.
1995-07-12fix more compilation bugsKen Raeburn1-2/+3
1995-07-07 Add SPARC ELF PIC support.Ian Lance Taylor1-2/+3
* write.c (fixup_segment): Pass fixP to TC_RELOC_RTSYM_LOC_FIXUP, not fixP->fx_r_type. * config/tc-sparc.c (sparc_pic_code): New global variable. (md_apply_fix): If generating PIC, adjust fx_addnumber for any non PC relative reloc. (tc_gen_reloc): If generating PIC, adjust various reloc types. Remove fx_pcrel assert, since it is no longer true. (md_parse_option): Handle -K PIC. * config/tc-sparc.h (sparc_pic_code): Declare if OBJ_ELF. (TC_RELOC_RTSYM_LOC_FIXUP): Define if OBJ_ELF. (tc_fix_adjustable): Don't adjust PC relative relocs if PIC. * config/tc-i386.h (TC_RELOC_RTSYM_LOC_FIXUP): Take a fixp, not a reloc type. PR 7131.
1995-07-06fsf address updateKen Raeburn1-2/+2
1995-06-21m68k fixes from Andreas Schwab, with minor changesKen Raeburn1-10/+42
1995-03-03If -mrelocatable, warn about relocs that are incompatible.Michael Meissner1-12/+16
1995-01-21tipoIan Lance Taylor1-3/+7
1995-01-19Cleanup of VAX and VMS code, from Pat Rankin:Ken Raeburn1-2/+2
* config/obj-vms.c: Changed exported function names to lower case. (Changed call sites in write.c.) Declare VMS system function names used, conditional on actually being on VMS. Changed many functions that returned no useful value to now be declared to return void. Removed many unused variables. Supply missing return statements or values. Supply `default' case in switch statements. Ensure local variables get initialized. * config/tc-vax.c: Minor changes to silence "gcc -Wall". * config/obj-vms.h, config/tc-vax.h: Added some missing declarations.
1995-01-19 * write.c (fix_new_internal): Clear fx_bsr on those targets whichIan Lance Taylor1-1/+1
use it.
1994-12-31Handle .space directive with non-constant operand:Ken Raeburn1-3/+26
* 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-10* write.c (write_relocs) [RELOC_EXPANSION_POSSIBLE]: Use bfd_install_relocation.Ken Raeburn1-22/+75
1994-09-29* write.c (print_fixup): Print source location on first line. Show fx_r_typeKen Raeburn1-2/+14
and fx_addsy fields.
1994-09-28(fix_new_exp): Handle O_add by creating an expression-valued symbol, andKen Raeburn1-20/+98
calling fix_new_exp recursively. (adjust_reloc_syms): If a fixup's symbol value is a sum of an undefined symbol and a constant, fold the constant into the fixup, and refer to the undefined symbol directly. Then process the fixup again from scratch. (write_object_file): Before calling adjust_reloc_syms, make a pass through the symbol list trying to resolve values. (print_fixup): New routine, for debugging. (write_relocs): Call bfd_install_relocation. Deleted various hacks for working around problems with bfd_perform_relocation.
1994-09-13* write.c (fixup_segment): Test TC_RELOC_RTSYM_LOC_FIXUP on fixup beforeKen Raeburn1-12/+76
processing same-section pcrel relocations. (TC_RELOC_RTSYM_LOC_FIXUP): Default to 1.
1994-06-03 * as.h: Replace flagseen with separate variables.David MacKenzie1-8/+14
* 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-05-02 * subsegs.h (segment_info_type): Use fix_tail field even ifIan Lance Taylor1-2/+21
BFD_ASSEMBLER. * subsegs.c (subseg_change): Initialize fix_tail field. (subseg_get): Likewise. * write.c (frags_chained): New static variable. (fix_new_internal): If frags_chained is set, use fix_root and fix_tail from seg_info (now_seg), rather than frchain_now. (chain_frchains_together_1): Set fix_tail field. (chain_frchains_together): Set frags_chained.
1994-03-19* write.c (symbol_table_frozen): New variable, to be set after bfd_set_symtabKen Raeburn1-72/+110
is called. (dump_section_relocs): Note whether a symbol is a section symbol or not. (adjust_reloc_syms): For now, always supply an absolute symbol for fixups without symbols but not yet `done'. Use section_symbol to get the symbol, instead of going directly for abs_symbol. (write_relocs) [DEBUG4]: Abort if any symbol referred to by a reloc is not a section symbol and is not in the symbol table. (set_symtab): New function, broken out from write_object_file. Counts symbol table instead of relying on an earlier count. (write_object_file): Call set_symtab, but do it after potentially invoking the *_frob_file macros. Don't bother counting symbols. Call symbol_remove, instead of expanding it in place. Moved the conditionalized `object_file_size' declaration down to conditionalized block where it's used. When using the absolute symbol for a fixup without a symbol, set sy_used_in_reloc. (write_object_file) [BFD_ASSEMBLER]: Call section_symbol to get the correct symbol for the absolute section.
1994-02-18write.c (write_object_file): Removed register declarations.Ken Raeburn1-9/+13
1994-02-09(adjust_reloc_syms): Use abs_symbol instead of calling section_symbol.Ken Raeburn1-7/+3
1994-02-08 * write.c (write_relocs): Print some sensible error message ifKen Raeburn1-21/+27
bfd_perform_relocation returns bfd_reloc_overflow.
1994-02-05Don't refer to new fields unless BFD_ASSEMBLER (from sac).Ian Lance Taylor1-0/+2
1994-02-05 Changed relocs to be based on subsegments (when BFD_ASSEMBLER).Ian Lance Taylor1-51/+49
* subsegs.h (struct frchain): If BFD_ASSEMBLER, added new fields fix_root and fix_tail. (segment_info_type): If BFD_ASSEMBLER, don't define fix_tail field. * write.c (fix_new_internal): If BFD_ASSEMBLER, set fix_rootP and fix_tailP based on frchain_now, not seg_info (now_seg). (chain_frchains_together_1): Chain the subsegment relocs together. * subsegs.c (subseg_change): Don't clear fix_tail field. (subseg_get): Likewise. * literal.c (add_to_literal_pool): Look through the relocs via frchain_now, not seginfo. * write.c (write_object_file): Simplified usage of obj_frob_symbol and tc_frob_symbol. Always call both if the symbol is going to be output. * write.c (relax_segment): Use %ld rather than %d when printing fragP->fr_var, and cast it to long.
1994-01-30* write.c (write_object_file): If tc_frob_file is defined, call itKen Raeburn1-0/+4
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-28* as.h: If __GNUC__ and inline are both undefined, define inline away.Ken Raeburn1-44/+82
* 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.
1993-12-20* write.c (adjust_reloc_syms) [RELOC_REQUIRES_SYMBOL]: If no symbol is presentKen Raeburn1-2/+21
(i.e., relocation against absolute), create a phony local symbol, and use it in the reloc. (fixup_segment): When adjusting a reloc with an absolute symbol, have TC_FORCE_RELOCATION control clearing add_symbolP too. * config/tc-sparc.h (RELOC_REQUIRES_SYMBOL): Define.