Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Stafford Horne <shorne@gmail.com>
To: Nick Clifton <nickc@redhat.com>
Cc: Richard Henderson <rth@twiddle.net>,
	binutils@sourceware.org,	GDB patches <gdb-patches@sourceware.org>,
	Openrisc <openrisc@lists.librecores.org>
Subject: Re: [PATCH 0/4] OpenRISC binutils updates and new relocs
Date: Wed, 19 Sep 2018 13:23:00 -0000	[thread overview]
Message-ID: <20180919132340.GQ4594@lianli.shorne-pla.net> (raw)
In-Reply-To: <20b65fc3-5bbb-6e77-f598-4582204ee0e5@redhat.com>

On Tue, Sep 18, 2018 at 12:55:48PM +0100, Nick Clifton wrote:
> Hi Stafford,
> 
> >> There are a few minor formatting glitches, but nothing serious.
> > 
> > Will you be able to point them out?  Even just some hints?
> 
> Sure...
> 
> So for example in patch 1/4 there is:
> 
>   +enum {
>   +  RTYPE_LO = 0,
> 
> when really it should be:
> 
>   +enum 
>   +{
>   +  RTYPE_LO = 0,
> 
> (And similarly in other places.  Basically, try to avoid ending a line
> with an opening curly brace, unless that brace is the only character on
> the line).
> 
> Then there is:
> 
>   +static int
>   +parse_reloc(const char **strp)
> 
> Which ought to be:
> 
>   +static int
>   +parse_reloc (const char **strp)
> 
> Ie - a single space between the function name and its parameters.
> (I did say that these were minor formatting nits...)  In a similar
> vein there is:
> 
>   +  return parse_imm16(cd, strp, opindex, (long *) valuep, 0);
>   +}
>  
> which also needs a space between the function name and its arguments.
> 
> There are a few other cases of the above issues in the other patches,
> but nothing else of note.

Ack on the braces and function spaces.  I will clean those up.

> One other thing:  There are several places where you add calls to 
> abort().  Now this is not wrong, and certainly not a reason to 
> reject the patch, but I consider it to be unhelpful.  To my mind
> a library, or tool, should generate an error message when something
> goes wrong and not leave the user wondering why they have suddenly
> got a segmentation fault.
> 
> Plus if you have a call to abort() in the code you can bet that some 
> enterprising person with a binary fuzzer will find a way to trigger 
> it, and then file a CVE about it.  (Fixing CVEs is the bane of my 
> life as they involve lots of extra administrivia).

OK, I will fix those too.

> >> I do not see any need to add extra document for the new relocs, unless you
> >> have created new assembler pseudo-ops to generate them.
> 
> > As Richard mentioned we have added a few, see PATCH 3/4 in cpu/or1k.opc the
> > change:
> > 
> > 	(parse_reloc): Add new po(), gotpo() and gottppo() for LO13 relocations.
> > 
> > Is this what you mean?  I will look into adding the documentation for these.
> 
> Please do.  Most likely you will want to create a gas/doc/c-or1k.c file,
> (copying the contents from another, similar file and modifying as needed), and
> then patch the gas/doc/as.texi file to include it and the gas/doc/all.texi file
> to define a macro for it.

Sure I will do that.

> >> I do have one question though.  Is there a need to be able to distinguish 
> >> between binaries that use the new l.adrp instruction and those that don't.
> 
> > As Richard mentioned we don't handle this.
> > 
> > We have cases like this right now as well, i.e. binaries generated with `l.mul`
> > or `l.div` instructions will link fine into an executable that assume those
> > instrunctions should be emulated.  That doesn't throw an error and I don't think
> > it has been a problem.
> 
> OK, well it is your target, so if you are OK with this then so be it.
> I would recommend however thinking about a solution for the future, should the
> openRISC architecture gain more variants.  My suggestion would be to make use
> of ELF notes, as has been done with other ports.

Thanks, I will keep that in mind.

-Stafford


  parent reply	other threads:[~2018-09-19 13:23 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-21 14:38 Stafford Horne
2018-08-21 14:39 ` [PATCH 4/4] or1k: Add the l.muld, l.muldu, l.macu, l.msbu insns Stafford Horne
2018-08-21 14:39 ` [PATCH 3/4] or1k: Add the l.adrp insn and supporting relocations Stafford Horne
2018-08-21 14:39 ` [PATCH 2/4] or1k: Fix messages for relocations in shared libraries Stafford Horne
2018-08-21 14:39 ` [PATCH 1/4] or1k: Add relocations for high-signed and low-stores Stafford Horne
2018-09-08 21:35 ` [PATCH 0/4] OpenRISC binutils updates and new relocs Stafford Horne
2018-09-17 15:07   ` Nick Clifton
2018-09-17 16:29     ` Richard Henderson
     [not found]     ` <20180918095234.GP4594@lianli.shorne-pla.net>
2018-09-18 11:55       ` Nick Clifton
2018-09-18 12:08         ` Joel Sherrill
2018-09-21 12:41           ` Stafford Horne
2018-09-19 13:23         ` Stafford Horne [this message]
2018-09-27  6:08         ` Stafford Horne
2018-09-28 15:39           ` Nick Clifton
2018-10-01  7:08             ` Stafford Horne

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180919132340.GQ4594@lianli.shorne-pla.net \
    --to=shorne@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=gdb-patches@sourceware.org \
    --cc=nickc@redhat.com \
    --cc=openrisc@lists.librecores.org \
    --cc=rth@twiddle.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox