Subject: Re: Toolchain problems
To: Simon Burge <simonb@netbsd.org>
From: Krister Walfridsson <cato@df.lth.se>
List: port-pmax
Date: 04/18/1999 20:11:54
On Sun, 18 Apr 1999, Simon Burge wrote:

> This is on the machine building the 1.4_ALPHA snapshots.  Can you try
> the ld from the latest snapshot?

My ISP had some problems so I haven't got the new snapshot, but I played
with the debugger instead...

There seems to be an off-by-one error in ecofflink.c (in libbfd). The
question is why it's only I who have been affected? Anyway, the patch
below solves my problem. I'd appreciate if someone take a look at the
patch and verify that it's correct. I'll commit it on tuesday unless
I hear otherwise.

   /Krister



Index: gnu/dist/bfd/ecofflink.c
===================================================================
RCS file: /cvsroot/src/gnu/dist/bfd/ecofflink.c,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 ecofflink.c
--- ecofflink.c 1999/02/02 19:51:52     1.1.1.2
+++ ecofflink.c 1999/04/18 18:10:17
@@ -2085,7 +2085,6 @@
          pdr_ptr = ((char *) debug_info->external_pdr
                     + fdr_ptr->ipdFirst * external_pdr_size);
          pdr_end = pdr_ptr + fdr_ptr->cpd * external_pdr_size;
-         (*debug_swap->swap_pdr_in) (abfd, (PTR) pdr_ptr, &pdr);
          /* Find PDR that is closest to OFFSET.  If pdr.prof is set,
             the procedure entry-point *may* be 0x10 below pdr.adr.  We
             simply pretend that pdr.prof *implies* a lower entry-point.
@@ -2093,9 +2092,9 @@
             in front of the function as belonging to the function.  */
          for (pdr_hold = NULL;
               pdr_ptr < pdr_end;
-              (pdr_ptr += external_pdr_size,
-               (*debug_swap->swap_pdr_in) (abfd, (PTR) pdr_ptr, &pdr)))
+              pdr_ptr += external_pdr_size)
            {
+             (*debug_swap->swap_pdr_in) (abfd, (PTR) pdr_ptr, &pdr);
              if (offset >= (pdr.adr - 0x10 * pdr.prof))
                {
                  dist = offset - (pdr.adr - 0x10 * pdr.prof);