This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: PC-relative Processing
- To: Tracy Kuhrt <Tracy dot Kuhrt at microchip dot com>
- Subject: Re: PC-relative Processing
- From: Alan Modra <amodra at bigpond dot net dot au>
- Date: Wed, 27 Jun 2001 13:00:35 +0930
- Cc: binutils at sourceware dot cygnus dot com
- References: <993252046.6863.ezmlm@sources.redhat.com> <3B37A5BC.A07D128F@microchip.com>
On Mon, Jun 25, 2001 at 01:57:33PM -0700, Tracy Kuhrt wrote:
>
> In that case, I would like to suggest the following patch to 2.11 sources:
> 2001-06-25 Tracy A. Kuhrt <Tracy.Kuhrt@microchip.com>
> * gas/write.c: Add call to MD_PCREL_FROM_SECTION before disabling PC-relative processing.
> This will allow the target machine to specify the location from which a PC relative jump containing
> a
> subtraction expression should be calculated.
OK, but we'll put in mainline for at least a week or two to discover
what breaks before migrating to 2.11.
/grumble Your ChangeLog entry isn't correct. Format for an 80 column
display, filename relative to ChangeLog file, and include function name.
Also, the adjustment should only be done if pcrel.
/nogrumble
I'm committing the following.
gas/ChangeLog
2001-06-27 Tracy A. Kuhrt <Tracy.Kuhrt@microchip.com>
* write.c (fixup_segment <Difference of 2 syms same seg>): If
pcrel, subtract MD_PCREL_FROM_SECTION value.
--
Alan Modra
Index: write.c
===================================================================
RCS file: /cvs/src/src/gas/write.c,v
retrieving revision 1.37
diff -u -p -r1.37 write.c
--- write.c 2001/05/27 12:17:38 1.37
+++ write.c 2001/06/27 03:04:24
@@ -2661,8 +2661,10 @@ fixup_segment (fixP, this_segment_type)
as_bad_where (fixP->fx_file, fixP->fx_line,
_("callj to difference of 2 symbols"));
#endif /* TC_I960 */
- add_number += S_GET_VALUE (add_symbolP) -
- S_GET_VALUE (sub_symbolP);
+ add_number += (S_GET_VALUE (add_symbolP)
+ - S_GET_VALUE (sub_symbolP));
+ if (pcrel)
+ add_number -= MD_PCREL_FROM_SECTION (fixP, this_segment_type);
add_symbolP = NULL;
pcrel = 0; /* No further pcrel processing. */