Wed Dec 30 10:18:57 1992 Ian Lance Taylor (ian@cygnus.com)

* 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.
This commit is contained in:
Ian Lance Taylor 1992-12-30 20:34:14 +00:00
parent 70834409a7
commit 85825401dc
7 changed files with 199 additions and 56 deletions

View file

@ -1,3 +1,71 @@
Wed Dec 30 10:18:57 1992 Ian Lance Taylor (ian@cygnus.com)
* 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.
Mon Dec 28 10:32:05 1992 Ken Raeburn (raeburn@cygnus.com) Mon Dec 28 10:32:05 1992 Ken Raeburn (raeburn@cygnus.com)
* app.c (app_push): Use memcpy, not bcopy. * app.c (app_push): Use memcpy, not bcopy.

View file

@ -52,7 +52,6 @@ ho-sunos.h
ho-sysv.h ho-sysv.h
ho-vax.h ho-vax.h
ho-vms.h ho-vms.h
i386aix.mt
i386coff.mt i386coff.mt
m68k.mt m68k.mt
m68kcoff.mt m68kcoff.mt
@ -140,7 +139,76 @@ echo Done in `pwd`.
# #
# #
# $Log$ # $Log$
# Revision 1.30 1992/12/08 09:42:06 raeburn # Revision 1.31 1992/12/30 20:34:14 ian
# Wed Dec 30 10:18:57 1992 Ian Lance Taylor (ian@cygnus.com)
#
# * 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.
#
# Revision 1.30 1992/12/08 09:42:06 raeburn
# missed tc-tahoe files # missed tc-tahoe files
# #
# Revision 1.29 1992/12/08 09:30:28 raeburn # Revision 1.29 1992/12/08 09:30:28 raeburn

View file

@ -37,15 +37,22 @@ configdirs=doc
gas_host=generic gas_host=generic
case "${host}" in case "${host}" in
a29k-*-* | rs6000-*-* | vax-*-*) a29k-*-* | rs6000-*-* | vax-*-*)
gas_host=${host_cpu} case "${host_os}" in
vms*) gas_host=vms ;;
bsd*) gas_host=bsd ;;
*) gas_host=${host_cpu} ;;
esac
;; ;;
mips-dec-ultrix) mips-dec-ultrix)
gas_host=decstation gas_host=decstation
;; ;;
i386-ibm-aix) i[34]86-ibm-aix*)
gas_host=i386aix gas_host=i386aix
;; ;;
i[34]86-*-isc*)
gas_host=sysv
;;
m68k-sun-sunos*) m68k-sun-sunos*)
gas_host=sun3 gas_host=sun3
;; ;;
@ -98,14 +105,15 @@ case ${target} in
gas_target=ebmon29k gas_target=ebmon29k
;; ;;
i[34]86-ibm-aix*) i[34]86-ibm-aix*)
obj_format=coff obj_format=coffbfd
gas_target=i386aix need_bfd="./../bfd/libbfd.a"
gas_target=i386coff
emulation=i386aix emulation=i386aix
;; ;;
i[34]86-*-bsd*) i[34]86-*-bsd*)
obj_format=aout obj_format=aout
;; ;;
i[34]86-*-coff | i[34]86-*-sysv* | i[34]86-*-sco*) i[34]86-*-coff | i[34]86-*-sysv* | i[34]86-*-sco* | i[34]86-*-isc*)
obj_format=coffbfd obj_format=coffbfd
need_bfd="./../bfd/libbfd.a" need_bfd="./../bfd/libbfd.a"
gas_target=i386coff gas_target=i386coff
@ -136,7 +144,7 @@ case ${target} in
sparclite-fujitsu-none) sparclite-fujitsu-none)
obj_format=aout obj_format=aout
;; ;;
*-*-aout | *-*-scout) *-*-aout | *-*-scout | *-*-linux)
obj_format=aout obj_format=aout
;; ;;
*-*-bout* | *-*-nindy*) *-*-bout* | *-*-nindy*)
@ -174,12 +182,16 @@ case ${target} in
*-*-coff) *-*-coff)
obj_format=coff obj_format=coff
;; ;;
*-*-vms)
obj_format=vms
;;
esac esac
# assign floating point type # assign floating point type
case ${target_cpu} in case ${target_cpu} in
ns32k) atof=ns32k ;; ns32k) atof=ns32k ;;
vax) atof=vax ;; vax) atof=vax ;;
tahoe) atof=tahoe ;;
*) atof=ieee ;; *) atof=ieee ;;
esac esac

View file

@ -567,13 +567,17 @@ operand (expressionP)
case '.': case '.':
if (!is_part_of_name (*input_line_pointer)) if (!is_part_of_name (*input_line_pointer))
{ {
char *fake;
extern struct obstack frags; extern struct obstack frags;
/* /* JF: '.' is pseudo symbol with value of current location
JF: '.' is pseudo symbol with value of current location in current in current segment. */
segment. . . #ifdef DOT_LABEL_PREFIX
*/ fake = ".L0\001";
symbolP = symbol_new ("L0\001", #else
fake = "L0\001";
#endif
symbolP = symbol_new (fake,
now_seg, now_seg,
(valueT) (obstack_next_free (&frags) - frag_now->fr_literal), (valueT) (obstack_next_free (&frags) - frag_now->fr_literal),
frag_now); frag_now);

View file

@ -587,7 +587,7 @@ read_a_source_file (name)
that goes with this #APP There is one. The specs that goes with this #APP There is one. The specs
guarentee it. . . */ guarentee it. . . */
tmp_len = buffer_limit - s; tmp_len = buffer_limit - s;
tmp_buf = xmalloc (tmp_len); tmp_buf = xmalloc (tmp_len + 1);
bcopy (s, tmp_buf, tmp_len); bcopy (s, tmp_buf, tmp_len);
do do
{ {
@ -1147,19 +1147,28 @@ s_lcomm (needs_align)
S_GET_OTHER (symbolP) == 0 && S_GET_OTHER (symbolP) == 0 &&
S_GET_DESC (symbolP) == 0 && S_GET_DESC (symbolP) == 0 &&
#endif /* OBJ_AOUT or OBJ_BOUT */ #endif /* OBJ_AOUT or OBJ_BOUT */
(((S_GET_SEGMENT (symbolP) == SEG_BSS) && (S_GET_VALUE (symbolP) == local_bss_counter)) (S_GET_SEGMENT (symbolP) == SEG_BSS
|| (!S_IS_DEFINED (symbolP) && S_GET_VALUE (symbolP) == 0))) || (!S_IS_DEFINED (symbolP) && S_GET_VALUE (symbolP) == 0)))
{ {
if (needs_align) char *p;
{ segT current_seg = now_seg;
/* Align */ subsegT current_subseg = now_subseg;
align = ~((~0) << align); /* Convert to a mask */
local_bss_counter = subseg_new (SEG_BSS, 1);
(local_bss_counter + align) & (~align);
} if (align)
frag_align (align, 0);
/* detach from old frag */
if (S_GET_SEGMENT (symbolP) == SEG_BSS)
symbolP->sy_frag->fr_symbol = NULL;
symbolP->sy_frag = frag_now;
p = frag_var (rs_org, 1, 1, (relax_substateT)0, symbolP,
temp, (char *)0);
*p = 0;
S_SET_VALUE (symbolP, local_bss_counter);
S_SET_SEGMENT (symbolP, SEG_BSS); S_SET_SEGMENT (symbolP, SEG_BSS);
#ifdef OBJ_COFF #ifdef OBJ_COFF
/* The symbol may already have been created with a preceding /* The symbol may already have been created with a preceding
* ".globl" directive -- be careful not to step on storage * ".globl" directive -- be careful not to step on storage
@ -1170,13 +1179,11 @@ s_lcomm (needs_align)
S_SET_STORAGE_CLASS (symbolP, C_STAT); S_SET_STORAGE_CLASS (symbolP, C_STAT);
} }
#endif /* OBJ_COFF */ #endif /* OBJ_COFF */
symbolP->sy_frag = &bss_address_frag; subseg_new (current_seg, current_subseg);
local_bss_counter += temp;
} }
else else
{ {
as_bad ("Ignoring attempt to re-define symbol from %d. to %d.", as_bad ("Ignoring attempt to re-define symbol %s.", name);
S_GET_VALUE (symbolP), local_bss_counter);
} }
demand_empty_rest_of_line (); demand_empty_rest_of_line ();

View file

@ -37,7 +37,6 @@ struct hash_control *
sy_hash; /* symbol-name => struct symbol pointer */ sy_hash; /* symbol-name => struct symbol pointer */
/* Below are commented in "symbols.h". */ /* Below are commented in "symbols.h". */
unsigned int local_bss_counter;
symbolS *symbol_rootP; symbolS *symbol_rootP;
symbolS *symbol_lastP; symbolS *symbol_lastP;
symbolS abs_symbol; symbolS abs_symbol;
@ -48,11 +47,7 @@ symbolS *dot_bss_symbol;
struct obstack notes; struct obstack notes;
#if __STDC__ == 1 static void fb_label_init PARAMS ((void));
static void fb_label_init (void);
#else /* not __STDC__ */
static void fb_label_init ();
#endif /* not __STDC__ */
void void
symbol_begin () symbol_begin ()
@ -62,7 +57,6 @@ symbol_begin ()
sy_hash = hash_new (); sy_hash = hash_new ();
memset ((char *) (&abs_symbol), '\0', sizeof (abs_symbol)); memset ((char *) (&abs_symbol), '\0', sizeof (abs_symbol));
S_SET_SEGMENT (&abs_symbol, SEG_ABSOLUTE); /* Can't initialise a union. Sigh. */ S_SET_SEGMENT (&abs_symbol, SEG_ABSOLUTE); /* Can't initialise a union. Sigh. */
local_bss_counter = 0;
#ifdef LOCAL_LABELS_FB #ifdef LOCAL_LABELS_FB
fb_label_init (); fb_label_init ();
#endif /* LOCAL_LABELS_FB */ #endif /* LOCAL_LABELS_FB */
@ -280,10 +274,8 @@ colon (sym_name) /* just seen "x:" - rattle symbols & frags */
} }
else else
{ {
/* /* It is a .comm/.lcomm being converted to initialized
* It is a .comm/.lcomm being converted data. */
* to initialized data.
*/
symbolP->sy_frag = frag_now; symbolP->sy_frag = frag_now;
#ifdef VMS #ifdef VMS
symbolP->sy_other = const_flag; symbolP->sy_other = const_flag;
@ -794,7 +786,6 @@ static void
fb_label_init () fb_label_init ()
{ {
memset ((void *) fb_low_counter, '\0', sizeof (fb_low_counter)); memset ((void *) fb_low_counter, '\0', sizeof (fb_low_counter));
return;
} /* fb_label_init() */ } /* fb_label_init() */
/* add one to the instance number of this fb label */ /* add one to the instance number of this fb label */
@ -977,12 +968,4 @@ decode_local_label_name (s)
return (symbol_decode); return (symbol_decode);
} /* decode_local_label_name() */ } /* decode_local_label_name() */
/*
* Local Variables:
* comment-column: 0
* fill-column: 131
* End:
*/
/* end of symbols.c */ /* end of symbols.c */

View file

@ -152,7 +152,6 @@ write_object_file ()
register fragS *fragP; /* Track along all frags. */ register fragS *fragP; /* Track along all frags. */
register struct frchain *next_frchainP; register struct frchain *next_frchainP;
register fragS **prev_fragPP; register fragS **prev_fragPP;
unsigned int data_siz;
long object_file_size; long object_file_size;
@ -286,7 +285,6 @@ write_object_file ()
else else
{ {
H_SET_DATA_SIZE (&headers, 0); H_SET_DATA_SIZE (&headers, 0);
data_siz = 0;
} }
#ifdef OBJ_BOUT #ifdef OBJ_BOUT
@ -308,7 +306,7 @@ write_object_file ()
/* Slide all the frags */ /* Slide all the frags */
if (bss_frag_root) if (bss_frag_root)
{ {
relax_addressT slide = bss_address_frag.fr_address + local_bss_counter; relax_addressT slide = bss_address_frag.fr_address;
for (fragP = bss_frag_root; fragP; fragP = fragP->fr_next) for (fragP = bss_frag_root; fragP; fragP = fragP->fr_next)
{ {
@ -317,11 +315,12 @@ write_object_file ()
} }
#endif #endif
if (bss_last_frag) if (bss_last_frag)
{ H_SET_BSS_SIZE (&headers,
local_bss_counter += bss_last_frag->fr_address - bss_frag_root->fr_address; bss_last_frag->fr_address - bss_frag_root->fr_address);
} else
H_SET_BSS_SIZE (&headers, local_bss_counter); H_SET_BSS_SIZE (&headers, 0);
/* /*
* *
@ -660,7 +659,9 @@ write_object_file ()
/* /*
* Now do the VMS-dependent part of writing the object file * Now do the VMS-dependent part of writing the object file
*/ */
VMS_write_object_file (H_GET_TEXT_SIZE (&headers), data_siz, VMS_write_object_file (H_GET_TEXT_SIZE (&headers),
H_GET_DATA_SIZE (&headers),
H_GET_BSS_SIZE (&headers),
text_frag_root, data_frag_root); text_frag_root, data_frag_root);
#endif /* VMS */ #endif /* VMS */
} /* write_object_file() */ } /* write_object_file() */