[PATCH] Fix sleb128 encoding for difference expressions

Julian Brown julian@codesourcery.com
Thu Apr 11 11:04:00 GMT 2013


On Mon, 8 Apr 2013 16:09:44 +0930
Alan Modra <amodra@gmail.com> wrote:

> On Mon, Apr 08, 2013 at 03:59:55PM +0930, Alan Modra wrote:
> > On Mon, Apr 08, 2013 at 02:34:13PM +0930, Alan Modra wrote:
> > > On Fri, Apr 05, 2013 at 05:00:02PM +0100, Julian Brown wrote:
> > > > > > On Mon, 12 Nov 2012 12:19:18 +0000
> > > > > > Julian Brown <julian@codesourcery.com> wrote:
> > > > > > > This is a more conservative version of the patch, which
> > > > > > > *only* affects assembly of .sleb128 directives.
> > > 
> > > That one was
> > > http://sourceware.org/ml/binutils/2012-11/msg00141.html
> > > 
> > > It still applies, but I see testsuite failures on x86_64-linux.
> > > 
> > > First one is:
> > > regexp_diff match failure
> > > regexp "^ 0000 7d2a0000 00000000 00000000 00000000  .*$"
> > > line   " 0000
> > > 7d2a                                 }*              "
> > > FAIL: .sleb128 tests (2)
> > > 
> > > I'd suggest making the match
> > >  0+ 7d2a.*
> > > and similarly with other testcases.
> > > 
> > > Patch is OK with those changes.
> > 
> > Oh, and another thing I just noticed, you need to ensure these tests
> > are only run on ELF targets.  Probably best to move them to
> > gas/testsuite/gas/elf/
> 
> Oops, no, sorry.  We do support .sleb128 on non-ELF.  But AOUT for
> instance typically won't have .data starting at zero for your
> testcases..  So my suggestion to use 0+ wasn't quite correct.
> 
> .* 7d2a.*
> instead.

Thanks, I've committed the attached version of the patch. Unfortunately
though, I forgot that one of the tests fails on non-BFD64 targets
(sleb128-6.[sd]) -- quite rightly, since the assembly file tries to
unconditionally manipulate 64-bit quantities. I had a hack in our local
sources' gas.exp:

# The following test requires a "BFD64" host, but there's no easy way of
# determining whether we have one of those here.  Only run the test on MIPS
# for now.
if { [istarget "mips*-*-*"] } {
  run_dump_test sleb128-6
}

I don't think that's suitable for upstream, and will try to figure out a
better solution (suggestions appreciated), but for now I've simply
omitted the whole test.

Cheers,

Julian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sleb128-fix-10.diff
Type: text/x-patch
Size: 13875 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20130411/538b718a/attachment.bin>


More information about the Binutils mailing list