public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Joseph Myers <joseph@codesourcery.com>
To: Fergus Dall <sidereal@google.com>
Cc: <libc-alpha@sourceware.org>, Mike Frysinger <vapier@google.com>,
	clumptini <clumptini@google.com>, <chromeos-toolchain@google.com>
Subject: Re: [PATCH v2 2/2] rtld: Add tests for new --no-default-paths option
Date: Thu, 27 May 2021 16:36:06 +0000	[thread overview]
Message-ID: <alpine.DEB.2.22.394.2105271628320.416177@digraph.polyomino.org.uk> (raw)
In-Reply-To: <CAAjxMxcZ6YoCCbVEMnMqEt-V9+nkYcSrzWxKqpf6=A9gkBQS2w@mail.gmail.com>

On Thu, 27 May 2021, Fergus Dall via Libc-alpha wrote:

> +const char libc[] = "/libc.so.6";
> +const char libdl[] = "/libdl.so.2";

If these are meant to be the SONAMEs of libc and libdl (with "/" 
prepended), you should use LIBC_SO and LIBDL_SO from <gnu/lib-names.h>.  
Some configurations have different SONAMEs (look for libc= and libdl= in 
shlib-versions files).  Also watch out for any interaction with Florian's 
patches to move libdl into libc.

> +  strcpy(lib_src, support_slibdir_prefix);

Throughout this patch, there should be a space before '(' in function 
calls; tests should follow GNU style, like other glibc code.  (In the GCC 
and GDB testsuites, it's useful to have code with a range of different 
styles, to make sure those tools work well with such code, but that 
doesn't apply to the glibc testsuite.)

> +const char libc[] = "/libc.so.6";
> +const char libdl[] = "/libdl.so.2";

Same comment about using <gnu/lib-names.h> applies here.

> +int main(int argc, char *argv[]) {
> +  if (argc < 2) {
> +    FAIL_EXIT1(usage);
> +  }

Again, GNU style fixes.  Return type on its own line, space before '(', 
open braces on their own lines (and indented from the "if").

-- 
Joseph S. Myers
joseph@codesourcery.com

  reply	other threads:[~2021-05-27 16:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-27 13:55 [PATCH v2 1/2] rtld: Add " Fergus Dall
2021-05-27 13:56 ` [PATCH v2 2/2] rtld: Add tests for new " Fergus Dall
2021-05-27 16:36   ` Joseph Myers [this message]
2021-05-27 15:08 ` [PATCH v2 1/2] rtld: Add " Florian Weimer
2021-06-06 16:27   ` Fergus Dall

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=alpine.DEB.2.22.394.2105271628320.416177@digraph.polyomino.org.uk \
    --to=joseph@codesourcery.com \
    --cc=chromeos-toolchain@google.com \
    --cc=clumptini@google.com \
    --cc=libc-alpha@sourceware.org \
    --cc=sidereal@google.com \
    --cc=vapier@google.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).