This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: PC-relative Processing


Alan Modra wrote:

> On Fri, Jun 15, 2001 at 08:50:07AM -0700, Tracy.Kuhrt@microchip.com wrote:
> > Any thoughts on what the appropriate solution is?  I do not wish to break
> > any other ports by suggesting adding the following line before turning off
> > pc-relative processing:
> >         add_number -= MD_PCREL_FROM_SECTION (fixP, this_segment_type);
>
> Sometimes, to fix things properly, you need to be willing to edit all
> the back-end files and entertain the idea of breaking things temporarily.
>
> In this case, I think most ports are broken on pcrel instructions like
> "jmp a-b", and your suggestion will fix them as well as your own port.
>
> --
> Alan Modra
>

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.

Index: gas/write.c
===================================================================
RCS file: /cvs/src/gas/write.c,v
retrieving revision 1.1.1.2
diff -u -p -r1.1.1.2 write.c
--- gas/write.c 2001/04/16 20:14:37     1.1.1.2
+++ gas/write.c 2001/06/25 20:41:07
@@ -2606,6 +2606,7 @@ fixup_segment (fixP, this_segment_type)
 #endif /* TC_I960  */
              add_number += S_GET_VALUE (add_symbolP) -
                S_GET_VALUE (sub_symbolP);
+             add_number -= MD_PCREL_FROM_SECTION (fixP, this_segment_type);

              add_symbolP = NULL;
              pcrel = 0;        /* No further pcrel processing.  */



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]