From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: yao@codesourcery.com (Yao Qi)
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 2/2] Detect 64-bit-ness in PowerPC Book III-E
Date: Wed, 14 Jan 2015 12:47:00 -0000 [thread overview]
Message-ID: <201501141247.t0ECl0bI032240@d03av02.boulder.ibm.com> (raw)
In-Reply-To: <87egqyrs13.fsf@codesourcery.com> from "Yao Qi" at Jan 14, 2015 10:54:16 AM
Yao Qi wrote:
> --- a/gdb/configure.ac
> +++ b/gdb/configure.ac
> @@ -1318,6 +1318,9 @@ AC_CHECK_FUNCS([getrusage getuid getgid \
> ttrace wborder wresize setlocale iconvlist libiconvlist btowc \
> setrlimit getrlimit posix_madvise waitpid \
> ptrace64 sigaltstack mkdtemp])
> +# glibc >= 2.16 provides getauxval().
> +AC_CHECK_FUNCS(getauxval)
> +
Any reason why this has to be a second AC_CHECK_FUNCS ? I thought
we usually just add functions to the one AC_CHECK_FUNCS call ...
> --- a/gdb/gdbserver/configure.ac
> +++ b/gdb/gdbserver/configure.ac
> @@ -91,6 +91,8 @@ AC_CHECK_HEADERS(sgtty.h termio.h termios.h sys/reg.h str=
> ing.h dnl
> sys/ioctl.h netinet/in.h sys/socket.h netdb.h dnl
> netinet/tcp.h arpa/inet.h)
> AC_CHECK_FUNCS(pread pwrite pread64)
> +# glibc >= 2.16 provides getauxval().
> +AC_CHECK_FUNCS(getauxval)
Likewise.
> + unsigned char data[2 * 8];
> + FILE *f = fopen ("/proc/self/auxv", "r");
> +
> + if (f == NULL)
> + return;
> +
> + while (fread (data, sizeof (data), 1, f) > 0)
> + {
> + unsigned long *data_p = (unsigned long *) data;
Hmm, this looks a violation of C aliasing rules. It would
be better to declare the array as unsigned long in the first
place, and cast to char for the fread call. Sorry for not
noticing that in the first review.
Otherwise this looks good.
Thanks,
Ulrich
--
Dr. Ulrich Weigand
GNU/Linux compilers and toolchain
Ulrich.Weigand@de.ibm.com
next prev parent reply other threads:[~2015-01-14 12:47 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-11 11:15 [PATCH] " Yao Qi
2014-12-11 15:31 ` Ulrich Weigand
2014-12-19 8:06 ` Yao Qi
2014-12-19 15:49 ` Ulrich Weigand
2015-01-11 8:27 ` [PATCH 0/2, V2] " Yao Qi
2015-01-11 8:27 ` [PATCH 2/2] " Yao Qi
2015-01-13 17:00 ` Ulrich Weigand
2015-01-14 2:54 ` Yao Qi
2015-01-14 12:47 ` Ulrich Weigand [this message]
2015-01-14 14:22 ` Yao Qi
2015-01-11 8:27 ` [PATCH 1/2] Move some ppc macros to nat/ppc-linux.h Yao Qi
2015-01-13 16:57 ` Ulrich Weigand
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=201501141247.t0ECl0bI032240@d03av02.boulder.ibm.com \
--to=uweigand@de.ibm.com \
--cc=gdb-patches@sourceware.org \
--cc=yao@codesourcery.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