PC-relative Processing
Alan Modra
amodra@bigpond.net.au
Tue Jun 26 20:25:00 GMT 2001
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. */
More information about the Binutils
mailing list