This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
RFC: Possible tc-mn10300.c patch
- To: <binutils at sources dot redhat dot com>
- Subject: RFC: Possible tc-mn10300.c patch
- From: Richard Sandiford <rsandifo at redhat dot com>
- Date: Thu, 22 Feb 2001 09:31:04 +0000 (GMT)
I'm coming across a problem in the mn10300 port for GAS. For a
non-relaxable section like .debug:
.section .debug
_f: .4byte _f
GAS doesn't output a reloc. This seems to happen whenever a non-relaxable
section contains the address of a symbol in the same section. Looking at
md_apply_fix3 in tc-mn10300.c, there's a condition:
if (fixp->fx_addsy != NULL
&& (! S_IS_DEFINED (fixp->fx_addsy)
|| (S_GET_SEGMENT (fixp->fx_addsy) != seg)))
{
fixp->fx_done = 0;
return 0;
}
but, after avoiding that return, fixp->fx_done always gets set to 1 for
BFD_RELOC_32 and the like.
I tried changing it so that fixp->fx_done is only set to 1 if there is no
symbol involved, and that solved the problem I was seeing. But I'm not
sure if this is generally OK. Still, I've attached the patch below. I'd
appreciate it if anyone can tell me the right way.
Thanks,
Richard
2001-02-21 Richard Sandiford <rsandifo@redhat.com>
* config/tc-mn10300.c (md_apply_fix3): Don't mark a fixup as
done if it's against a symbol.
Index: ./gas/config/tc-mn10300.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-mn10300.c,v
retrieving revision 1.16
diff -c -p -d -r1.16 tc-mn10300.c
*** ./gas/config/tc-mn10300.c 2000/11/17 08:47:52 1.16
--- ./gas/config/tc-mn10300.c 2001/02/22 09:10:40
*************** md_apply_fix3 (fixp, valuep, seg)
*** 1963,1969 ****
md_number_to_chars (fixpos, value, size);
! fixp->fx_done = 1;
return 0;
}
--- 1963,1970 ----
md_number_to_chars (fixpos, value, size);
! if (fixp->fx_addsy == NULL)
! fixp->fx_done = 1;
return 0;
}