aboutsummaryrefslogtreecommitdiff
path: root/gas/write.c
AgeCommit message (Collapse)AuthorFilesLines
1993-07-19(write_relocs): New function, split off from write_contents. Use memsetKen Raeburn1-4/+23
instead of bzero. (write_object_file): Apply write_relocs to each section before applying write_contents.
1993-07-14 * Removed sy_forward and replaced it with an undefined expressionIan Lance Taylor1-3/+15
as the value of a symbol. * struc-symbol.h (struct symbol): Removed sy_forward field. Added sy_resolved and sy_resolving single bit fields. * symbols.c (symbol_new): Don't initialize sy_forward field. (resolve_symbol_value): New function to adjust symbol value by fragment address, using recursion to resolve forward symbols. * symbols.h: Added prototype for new function. * read.c (pseudo_set): Set symbolP->sy_value to an undefined expression rather than setting symbolP->sy_forward. * write.c (write_object_file): Use resolve_symbol_value on symbols, keeping the common case (the old behaviour) inline. * config/obj-aout.c (obj_aout_frob_symbol): Removed sy_forward handling (subsumed by write.c change). * config/obj-coff.c, config/obj-coffbfd.c (obj_coff_val): Set sy_value rather than sy_forward. * config/obj-coffbfd.c (obj_coff_endef, yank_symbols): Check expression segment rather than sy_forward. (yank_symbols): Use resolve_symbol_value. (crawl_symbols): Removed extra pass over symbols. * config/obj-aout.c, config/obj-bout.c, config/obj-coff.c, config/obj-vms.c (obj_crawl_symbol_chain): Removed extra pass over symbols which handled sy_forward; use resolve_symbol_value instead. * config/obj-coff.h, config/obj-coffbfd.h (obj_frob_forward_symbol): Define. * config/obj-elf.c (obj_elf_stab_generic): Check expression segment rather than sy_forward. * config/obj-vms.c (VMS_Check_For_Main): Don't initialize sy_forward; do initialize sy_resolved and sy_resolving. * config/tc-hppa.h (STAB_FIXUP): Use sy_value, not sy_forward.
1993-07-14 * Changes to keep a full expression as the value of a symbol, notIan Lance Taylor1-0/+9
just a longword: * struc-symbol.h: New field sy_value. * as.h: Include expr.h before struc-symbol.h. * expr.h: Use struct symbol rather than symbolS. * symbols.c (S_GET_VALUE, S_SET_VALUE): Rewrote to retrieve value of sy_value field; compile unconditionally, not just if BFD_ASSEMBLER. * symbols.h: Compile S_{SG}ET_VALUE prototypes unconditionally. * write.c (write_object_file): Set BFD symbol value to gas symbol value. * config/obj-aout.h, config/obj-bout.h, config/obj-coff.h, config/obj-coffbfd.h, config/obj-generic.h, config/obj-vms.h (S_GET_VALUE, S_SET_VALUE): Removed macro definitions. * config/obj-ieee.c (S_GET_VALUE, S_SET_VALUE): Removed. * config/obj-coff.h, obj-coffbfd.h: Rewrote several macros to use S_GET_VALUE rather than ost_entry.n_value. * config/obj-aout.c (obj_symbol_to_chars), config/obj-bout.c (obj_symbol_to_chars), config/obj-coff.c (obj_symbol_to_chars), config/obj-coffbfd.c (symbol_to_chars): Get value to write out using S_GET_VALUE--don't assume it is already set. * config/obj-ieee.c (do_symbols): Set BFD symbol value to gas symbol value. * config/obj-vms.c (various): Don't assign directly to S_GET_VALUE; use S_SET_VALUE instead.
1993-07-07(write_object_file): Locals from_addr, to_addr, table_addr are now addressT.Ken Raeburn1-134/+276
Supply prototype for bfd_alloc for now. (fixup_segment): Local add_number is now valueT. Fix some range-checking bugs. (relax_align): Type `int' should be sufficient for the exponent. (fix_new): Argument offset is offsetT. Locals size and newsize are valueT.
1993-03-15 * write.c (write_contents): Compute the relocs before writing outIan Lance Taylor1-69/+67
the section contents. * config/obj-ecoff.h, config/obj-ecoff.c: Numerous changes to get symbol table and values right. * config/tc-mips.h (LOCAL_LABEL): If OBJ_ECOFF, any label starting with $L is local. * config/tc-mips.c (tc_gen_reloc): If OBJ_ECOFF, adjust the addend by the section vma. * config/z8k.mt (TARG_CPU_DEPENDENTS): The relevant file is z8k-opc.h, not z8k.h.
1993-03-12 * expr.c, write.c: Ultrix native 4.2 cc requires assert conditionIan Lance Taylor1-9/+16
to be on a single line.
1993-03-02set SEC_RELOC only if fixups are requiredKen Raeburn1-348/+749
1992-12-30Wed Dec 30 10:18:57 1992 Ian Lance Taylor (ian@cygnus.com)Ian Lance Taylor1-8/+9
* app.c, config/tc-*.c: Don't include read.h, since it is already included by as.h. * These are based on patches from Minh Tran-le <mtranle@paris.intellicorp.com>. * configure.in (i[34]86-ibm-aix*): Accept i486 for host. Use obj_format coffbfd and gas_target i386coff for target. (i[34]86-*-isc*): New host (uses sysv). * config/i386aix.mt: Removed (no longer used). * config/mh-i386aix (RANLIB): Use true rather than /bin/true. (MINUS_G): Removed. (LDFLAGS): Added, defined as -shlib. * config/te-i386aix.h (REVERSE_SORT_RELOCS): Undefine. * config/te-sco386.h (LOCAL_LABEL): Don't define. (DOT_LABEL_PREFIX): Define. * expr.c (operand): If DOT_LABEL_PREFIX, use .L0\001 as a label name rather than L0\001. * read.c (s_lcomm): Make a frag in SEG_BSS rather than using local_bss_counter. * symbols.c, symbols.h (local_bss_counter): Removed. * write.c (write_object_file): bss no longer uses local_bss_counter. Pass correct data and bss size to VMS_write_object_file. * config/obj-vms.c (VMS_write_object_file): Accept bss size as argument, rather than using local_bss_counter. * config/tc-m88k.c (s_bss): Don't use local_bss_counter. * config/tc-sparc.c (s_reserve): Don't use local_bss_counter. * config/obj-coffbfd.c (had_lineno, had_reloc): Removed. (size_section): Restored sanity check. (do_relocs_for): Base section address on s_paddr rather than computing it. Adjust a29k R_IHIHALF special case to account for section paddr (used to require paddr to be zero). If there are no reclos, set s_relptr to 0. Set relocation size in object_headers. (fill_section): Always set s_vaddr here, removing ZERO_BASED_SEGMENTS case. Force s_scnptr for bss to 0. Don't set NOLOAD for i386 .bss, because it confuses the SVR3 native linker. Set STYP_INFO for .comment. (coff_header_append): Use object headers and H_{SET,GET}_* macros. Make aouthdr writing depend on OBJ_COFF_OMIT_OPTIONAL_HEADER. (crawl_symbols): Handle 8 character section name correctly. Use H_{SET,GET}_* macros. (do_linenos_for): Set lineno size in object_headers. (write_object_file): Use H_{SET,GET}_* macros. Don't bother to set s_vaddr here. If string_byte_count remains 4, set it back to 0, and only write strings out if there are some. Call fill_section before do_relocs_for and do_linenos_for. (obj_coff_section): Handle optional quoted second argument giving section characteristics. (obj_coff_bss): Added to handle .bss. (obj_coff_ident): Added to handle .ident (puts string in .comment section). (obj_coff_lcomm): Put common symbols in .bss, not .data. (fixup_mdeps): Change to segment. Call frag_wane after md_convert_frag. (fixup_segment): Explicitly check S_IS_COMMON before making 386 adjustment (already happened only for common symbols, but this is clearer). * config/obj-coffbfd.h (OBJ_COFF_OMIT_OPTIONAL_HEADER): Define. * config/tc-i386.c (s_bss): Don't use if I386COFF. (md_pseudo_table): Ignore .optim and .noopt. (tc_coff_sizemachdep): New function. * config/tc-i386.h (REVERSE_SORT_RELOCS): Undef, for SVR3 compatibility. (LOCAL_LABEL): Removed definition. (DOT_LABEL_PREFIX): Defined.
1992-12-16Wed Dec 16 12:12:33 1992 Ian Lance Taylor (ian@cygnus.com)Ian Lance Taylor1-31/+29
* write.c, obj-ieee.c: don't define SUB_SEGMENT_ALIGN if it is already defined.
1992-12-03Some cleanup.Ken Raeburn1-170/+150
Deleted some unused code. Fixed some declarations to use PARAMS macro. Fixed up configure.in for new targets. Some whitespace/comment fixes. Merged config/ChangeLog.
1992-11-23Ran "indent", for GNU coding style; some code & comments still need fixup.Ken Raeburn1-841/+945
Removed some unneeded files. configure.in: Don't look for te-386bsd.h, which doesn't exist...
1992-09-14Sun Sep 13 20:30:10 1992 Ian Lance Taylor (ian@cygnus.com)Ian Lance Taylor1-2/+2
* write.c (fixup_segment): fixed missing parens in expression checking for byte or word overflow.
1992-08-19mainly link-relax changesKen Raeburn1-60/+69
1992-06-09 * subsegs.c (subsegs_begin): create bss0_frchainP in the same wasSteve Chamberlain1-20/+42
as data0_frchainP * write.c (write_object_file): various changes to handle data in the BSS segment in much the same was as stuff in the DATA segment. * subsegs.c (subseg_change): allow and handle a change into SEG_BSS.
1992-06-04Thu Jun 4 11:59:13 1992 Steve Chamberlain (sac@thepub.cygnus.com)Steve Chamberlain1-1/+2
* expr.c(expr): allow SEG_REGISTER in expressions. * read.c(pseudo_set): register expressions can be the source of a set. * subsegs.c (subseg_new): Now -R forces all changes to SEG_DATA to goto SEG_TEXT (if a.out) * write.c (write_object_file): If a.out don't use the old way for -R. * config/obj-a.out (s_sect): complain if the user tries to use a subsegment with a value which might interfere with out -R hackery. * config/tc-m68k.c (m68k_reg_parse): lookup names in symbol table rather than use ugly if tree. (init_regtable): insert register names into symbol table.
1992-06-02Fix -R problem from AdobeMichael Tiemann1-5/+38
1992-04-07Change a series of #if/#elif to #if/#else/#if.../#endif. The apolloSean Eric Fagan1-9/+5
compiler lies about being ANSI conformant.
1992-03-01Make the declarations of fix_new consistent under __STDC__. It mightMichael Tiemann1-4/+8
be better to #define NEED_FX_R_TYPE in TC_A29K and TC_SPARC instead of having this complicated conditional, but that's not my call.
1992-02-22 * app.c: MRI compatibility - allow single quote to start a string.Steve Chamberlain1-59/+30
* as.c: fix typo recently introduced. * as.h : Don't include aout/reloc.h - it's not right for COFF! * expr.c: Much rewriting, to accomodate MRI syntax for expressions. Also easier to read now. * listing.c: Put back defuns * read.c: modified to accept MRI syntax, put back listing pseudo ops so that an assembler built with NO_LISTING ignores list ops rather than pukes. * write.c, write.h: fixs - only keep a reloc type in a fix if the target machine is a SPARC or a 29K. * config/obj-aout.c: added s_sect pseudo op * config/obj-coffbfd.c: lints, set the filehdr flags right and fill in the timestamp. * config/obj-coffbfd.h: Since we don't include aout/reloc.h anymore, define all the relocs which the tc-<x> bit will use so we can translate from them to the coff types. * config/tc-a29k.c: reloc_type isn't ane enum any more * config/tc-m68k.c: Added NO_RELOC definition. Now compiles for sparc aout, 68k aout (MRI and MIT syntax), 29k coff. So far works as replacement for sparc and 68k /bin/as.
1992-02-21changes from Minh Tran-Le <TRANLE@INTELLICORP.COM> to support i386K. Richard Pixley1-23/+59
coff as it appears to be used on aix386.
1992-02-17fighting bitrot in a major wayK. Richard Pixley1-21/+10
1992-02-15White space and comment changes. #ifdef __STDC__ becomes #if __STDC__K. Richard Pixley1-4/+4
== 1. Get the declarations right in listing.[hc].
1992-02-13White space and comments only. The devo tree prior to this delta isK. Richard Pixley1-529/+530
tagged as "vanilla" for your convenience. There are also some comment changes.
1992-01-05* as.h: Move redefine of xfree.John Gilmore1-104/+59
* read.c: Use xmalloc, not malloc. * expr.c, input-scrub.c, write.c: Avoid "know" macros that cover more than one line, since this causes char strings with embedded newlines.
1991-07-27Polishing m68k support.K. Richard Pixley1-331/+389
1991-04-04Initial revisionK. Richard Pixley1-0/+1162