This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
v850 gas patch for weak symbols
- To: binutils at sourceware dot cygnus dot com
- Subject: v850 gas patch for weak symbols
- From: Nick Clifton <nickc at cygnus dot com>
- Date: Sat, 6 Nov 1999 14:06:47 GMT
- Reply-to: nickc at cygnus dot co dot uk
Hi Guys,
I have just checked in the following patch. It fixes the v850
targeted version of GAS so that it will not try to reolve relocs
against weak symbols, but instead allow the linker to do it.
Cheers
Nick
1999-11-06 Nick Clifton <nickc@cygnus.com>
* config/tc-v850.c (v850_force_relocation): Force relocation
for weak symbols.
(v850_pcrel_from_selection): Do not compute a pcrel offset if
the symbol is weak.
Index: gas/config/tc-v850.c
===================================================================
RCS file: /cvs/binutils/binutils/gas/config/tc-v850.c,v
retrieving revision 1.6
diff -p -r1.6 tc-v850.c
*** tc-v850.c 1999/07/07 09:34:14 1.6
--- tc-v850.c 1999/11/06 13:57:20
*************** v850_pcrel_from_section (fixp, section)
*** 2290,2298 ****
--- 2290,2300 ----
segT section;
{
/* If the symbol is undefined, or in a section other than our own,
+ or it is weak (in which case it may well be in another section,
then let the linker figure it out. */
if (fixp->fx_addsy != (symbolS *) NULL
&& (! S_IS_DEFINED (fixp->fx_addsy)
+ || S_IS_WEAK (fixp->fx_addsy)
|| (S_GET_SEGMENT (fixp->fx_addsy) != section)))
{
/* The symbol is undefined/not in our section.
*************** int
*** 2471,2476 ****
--- 2473,2481 ----
v850_force_relocation (fixp)
struct fix *fixp;
{
+ if (fixP->fx_addsy && S_IS_WEAK (fixP->fx_addsy))
+ return 1;
+
if (fixp->fx_r_type == BFD_RELOC_VTABLE_INHERIT
|| fixp->fx_r_type == BFD_RELOC_VTABLE_ENTRY)
return 1;