* read.c (s_comm): Check S_IS_COMMON as well as S_IS_DEFINED.

(s_mri_common): Check S_IS_COMMON unconditionally.
	* symbols.c (colon): Check S_IS_COMMON as well as S_IS_DEFINED.
	* config/tc-alpha.c (s_alpha_comm): Likewise.
	* config/tc-mips.c (nopic_need_relax): Likewise.
	* config/tc-ppc.c (ppc_elf_lcomm): Likewise.
	(ppc_pe_comm): Likewise.
	* config/obj-elf.c (obj_elf_common): Likewise.  Set segment of
	common symbol to bfd_com_section_ptr.
	* config/tc-sparc.c (s_common): Likewise.
	(tc_gen_reloc): Likewise.
This commit is contained in:
Ian Lance Taylor
1997-03-27 17:31:06 +00:00
parent 0e9c437767
commit 23ac3ca1f0
3 changed files with 36 additions and 10 deletions

View File

@ -1,3 +1,17 @@
Thu Mar 27 12:23:56 1997 Ian Lance Taylor <ian@cygnus.com>
* read.c (s_comm): Check S_IS_COMMON as well as S_IS_DEFINED.
(s_mri_common): Check S_IS_COMMON unconditionally.
* symbols.c (colon): Check S_IS_COMMON as well as S_IS_DEFINED.
* config/tc-alpha.c (s_alpha_comm): Likewise.
* config/tc-mips.c (nopic_need_relax): Likewise.
* config/tc-ppc.c (ppc_elf_lcomm): Likewise.
(ppc_pe_comm): Likewise.
* config/obj-elf.c (obj_elf_common): Likewise. Set segment of
common symbol to bfd_com_section_ptr.
* config/tc-sparc.c (s_common): Likewise.
(tc_gen_reloc): Likewise.
start-sanitize-d30v start-sanitize-d30v
Thu Mar 27 00:29:46 1997 Martin M. Hunt <hunt@pizza.cygnus.com> Thu Mar 27 00:29:46 1997 Martin M. Hunt <hunt@pizza.cygnus.com>

View File

@ -41,6 +41,14 @@
#include "elf/ppc.h" #include "elf/ppc.h"
#endif #endif
static bfd_vma elf_s_get_size PARAMS ((symbolS *));
static void elf_s_set_size PARAMS ((symbolS *, bfd_vma));
static bfd_vma elf_s_get_align PARAMS ((symbolS *));
static void elf_s_set_align PARAMS ((symbolS *, bfd_vma));
static void elf_copy_symbol_attributes PARAMS ((symbolS *, symbolS *));
static int elf_sec_sym_ok_for_reloc PARAMS ((asection *));
static void adjust_stab_sections PARAMS ((bfd *, asection *, PTR));
#ifdef NEED_ECOFF_DEBUG #ifdef NEED_ECOFF_DEBUG
static boolean elf_get_extr PARAMS ((asymbol *, EXTR *)); static boolean elf_get_extr PARAMS ((asymbol *, EXTR *));
static void elf_set_index PARAMS ((asymbol *, bfd_size_type)); static void elf_set_index PARAMS ((asymbol *, bfd_size_type));
@ -264,7 +272,7 @@ obj_elf_common (ignore)
*p = 0; *p = 0;
symbolP = symbol_find_or_make (name); symbolP = symbol_find_or_make (name);
*p = c; *p = c;
if (S_IS_DEFINED (symbolP)) if (S_IS_DEFINED (symbolP) && ! S_IS_COMMON (symbolP))
{ {
as_bad ("Ignoring attempt to re-define symbol"); as_bad ("Ignoring attempt to re-define symbol");
ignore_rest_of_line (); ignore_rest_of_line ();
@ -330,8 +338,8 @@ obj_elf_common (ignore)
if (S_GET_SEGMENT (symbolP) == bss_section) if (S_GET_SEGMENT (symbolP) == bss_section)
symbolP->sy_frag->fr_symbol = 0; symbolP->sy_frag->fr_symbol = 0;
symbolP->sy_frag = frag_now; symbolP->sy_frag = frag_now;
pfrag = frag_var (rs_org, 1, 1, (relax_substateT) 0, symbolP, size, pfrag = frag_var (rs_org, 1, 1, (relax_substateT) 0, symbolP,
(char *) 0); (offsetT) size, (char *) 0);
*pfrag = 0; *pfrag = 0;
S_SET_SIZE (symbolP, size); S_SET_SIZE (symbolP, size);
S_SET_SEGMENT (symbolP, bss_section); S_SET_SEGMENT (symbolP, bss_section);
@ -344,8 +352,7 @@ obj_elf_common (ignore)
S_SET_VALUE (symbolP, (valueT) size); S_SET_VALUE (symbolP, (valueT) size);
S_SET_ALIGN (symbolP, temp); S_SET_ALIGN (symbolP, temp);
S_SET_EXTERNAL (symbolP); S_SET_EXTERNAL (symbolP);
/* should be common, but this is how gas does it for now */ S_SET_SEGMENT (symbolP, bfd_com_section_ptr);
S_SET_SEGMENT (symbolP, bfd_und_section_ptr);
} }
} }
else else

View File

@ -1197,14 +1197,19 @@ insn_uses_reg (ip, reg, class)
else else
{ {
if ((ip->insn_mo->pinfo & MIPS16_INSN_READ_X) if ((ip->insn_mo->pinfo & MIPS16_INSN_READ_X)
&& ((ip->insn_opcode >> MIPS16OP_SH_RX) & MIPS16OP_MASK_RX) == reg) && (mips16_to_32_reg_map[((ip->insn_opcode >> MIPS16OP_SH_RX)
& MIPS16OP_MASK_RX)]
== reg))
return 1; return 1;
if ((ip->insn_mo->pinfo & MIPS16_INSN_READ_Y) if ((ip->insn_mo->pinfo & MIPS16_INSN_READ_Y)
&& ((ip->insn_opcode >> MIPS16OP_SH_RY) & MIPS16OP_MASK_RY) == reg) && (mips16_to_32_reg_map[((ip->insn_opcode >> MIPS16OP_SH_RY)
& MIPS16OP_MASK_RY)]
== reg))
return 1; return 1;
if ((ip->insn_mo->pinfo & MIPS16_INSN_READ_Z) if ((ip->insn_mo->pinfo & MIPS16_INSN_READ_Z)
&& ((ip->insn_opcode >> MIPS16OP_SH_MOVE32Z) && (mips16_to_32_reg_map[((ip->insn_opcode >> MIPS16OP_SH_MOVE32Z)
& MIPS16OP_MASK_MOVE32Z) == reg) & MIPS16OP_MASK_MOVE32Z)]
== reg))
return 1; return 1;
if ((ip->insn_mo->pinfo & MIPS16_INSN_READ_T) && reg == TREG) if ((ip->insn_mo->pinfo & MIPS16_INSN_READ_T) && reg == TREG)
return 1; return 1;
@ -9659,7 +9664,7 @@ nopic_need_relax (sym)
|| strcmp (symname, "end") == 0 || strcmp (symname, "end") == 0
|| strcmp (symname, "_gp_disp") == 0)) || strcmp (symname, "_gp_disp") == 0))
change = 1; change = 1;
else if (! S_IS_DEFINED (sym) else if ((! S_IS_DEFINED (sym) || S_IS_COMMON (sym))
&& (0 && (0
#ifndef NO_ECOFF_DEBUGGING #ifndef NO_ECOFF_DEBUGGING
|| (sym->ecoff_extern_size != 0 || (sym->ecoff_extern_size != 0