This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v2] [BZ #14579] rtld: limit self loading check to normal mode only
- From: Roland McGrath <roland at hack dot frob dot com>
- To: "Dmitry V. Levin" <ldv at altlinux dot org>
- Cc: libc-alpha at sourceware dot org, Carlos O'Donell <carlos_odonell at mentor dot com>
- Date: Fri, 14 Sep 2012 16:01:03 -0700 (PDT)
- Subject: Re: [PATCH v2] [BZ #14579] rtld: limit self loading check to normal mode only
- References: <20120914225230.GA16009@altlinux.org>
> +$(objpfx)tst-rtld-load-self.out: tst-rtld-load-self.sh $(objpfx)ld.so
> + $(SHELL) $^
We normally write the .out files via redirection.
So make this:
$(SHELL) $^ > $@
and don't redirect stdout in the script itself. If there is normally
some stderr output in a successful test run, then add 2>&1 to the
command line or put "exec 2>&1" inside the script (or 2>&1 on each of
its commands). If a successful run normally produces nothing on stderr,
then just leave stderr alone so it appears in build output.
> +# normal mode
> +$rtld $rtld > $out 2> $err
> +test $? -le 127 || exit
This doesn't make the .out file contents very informative.
I'd do "echo normal mode" or suchlike before each run.
We normally test all cases in a test rather than bailing out at the
first failure. So I'd make these:
test $? -eq 0 || result=1
etc. and "exit $result" at the end.
Thanks,
Roland