This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[gas/mep] handle weak symbols correctly.
- From: DJ Delorie <dj at redhat dot com>
- To: binutils at sourceware dot org
- Date: Tue, 11 Aug 2009 23:40:59 -0400
- Subject: [gas/mep] handle weak symbols correctly.
Committed.
* config/tc-mep.c (md_estimate_size_before_relax): Handle weak
symbols correctly.
(md_convert_frag): Likewise.
(md_pcrel_from_section): Likewise.
(mep_force_relocation): Likewise.
Index: config/tc-mep.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-mep.c,v
retrieving revision 1.11
diff -p -U3 -r1.11 config/tc-mep.c
--- config/tc-mep.c 24 Jul 2009 11:45:00 -0000 1.11
+++ config/tc-mep.c 12 Aug 2009 03:39:25 -0000
@@ -1529,6 +1529,7 @@ md_estimate_size_before_relax (fragS * f
fragP->fr_subtype = insn_to_subtype (fragP->fr_cgen.insn->base->num);
if (S_GET_SEGMENT (fragP->fr_symbol) != segment
+ || S_IS_WEAK (fragP->fr_symbol)
#ifdef MEP_IVC2_SUPPORTED
|| (mep_cop == EF_MEP_COP_IVC2
&& bfd_get_section_flags (stdoutput, segment) & SEC_MEP_VLIW)
@@ -1764,6 +1765,7 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UN
}
if (S_GET_SEGMENT (fragP->fr_symbol) != seg
+ || S_IS_WEAK (fragP->fr_symbol)
|| operand == MEP_OPERAND_PCABS24A2)
{
gas_assert (fragP->fr_cgen.insn != 0);
@@ -1809,6 +1811,7 @@ md_pcrel_from_section (fixS *fixP, segT
{
if (fixP->fx_addsy != (symbolS *) NULL
&& (! S_IS_DEFINED (fixP->fx_addsy)
+ || S_IS_WEAK (fixP->fx_addsy)
|| S_GET_SEGMENT (fixP->fx_addsy) != sec))
/* The symbol is undefined (or is defined but not in this section).
Let the linker figure it out. */
@@ -2013,6 +2016,9 @@ mep_force_relocation (fixS *fixp)
|| fixp->fx_r_type == BFD_RELOC_VTABLE_ENTRY)
return 1;
+ if (generic_force_reloc (fixp))
+ return 1;
+
/* Allow branches to global symbols to be resolved at assembly time.
This is consistent with way relaxable branches are handled, since
branches to both global and local symbols are relaxed. It also