[LV] Status of the toolchain build scripts?

Mikkel Lauritsen mikkel-vax at tala.dk
Tue Jun 26 22:29:37 CEST 2007


Jan-Benedict Glaw <jbglaw at lug-owl.de> wrote:

>> :-/  Can you send me the assmebler file and the GAS options used to
>> assemble it?
>
> Sure thing - i'll do that off-list.

Since then I've come up with a few minutes to rebuild gas with -O0 and do
some debugging, and why this hasn't appeared on the radar before is beyond
my imagination.

In gas/app.c, line 544 and onwards we loop over the chars in a quote
delimited string. Once we reach a delimiter or the end of the input buffer
the chars read are copied to the output and the from and to pointers
increased accordingly. If size of the remainder of the input buffer is the
same as the size of the remaining output buffer space what happens is that
the to pointer is set right after the end of the output buffer. Next call
of PUT(ch) (line 597) writes into unallocated memory. Boom.

This appears to me to be something that should happen really often, so
suggestions for why this isn't the case would be much appreciated.

The PUT macro explicitly avoids this by doing a goto tofull if the end of
the output buffer is reached, so something like the patch below should fix
the problem. Whether that's actually the case will have to be examined; I
have updated from upstream CVS/SVN since then, and trying to build the
kernel with a fresh toolchain bugs out even earlier with

include/linux/kallsyms.h:48: sorry, unimplemented: inlining failed in call
to '__check_printsym_format': recursive inlining

Oh well, I guess that's life on the bleeding edge :-)

Best regards,
  Mikkel

--- gas/app.c.orig      2007-06-26 21:59:35.000000000 +0200
+++ gas/app.c   2007-06-26 22:04:06.000000000 +0200
@@ -560,6 +560,8 @@
                memcpy (to, from, len);
                to += len;
                from += len;
+               if (to >= toend)
+                 goto tofull;
              }
          }

_______________________________________________
Linux-Vax mailing list
Linux-Vax at pergamentum.com
http://www.pergamentum.com/mailman/listinfo/linux-vax




More information about the Vax-linux mailing list