This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH rsa/hwcap2_v5] Add GLRO(dl_hwcap2), conditional on per platform HWCAP2_AVAIL.
- From: Roland McGrath <roland at hack dot frob dot com>
- To: Ryan S Arnold <rsa at linux dot vnet dot ibm dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Thu, 27 Jun 2013 14:19:38 -0700 (PDT)
- Subject: Re: [PATCH rsa/hwcap2_v5] Add GLRO(dl_hwcap2), conditional on per platform HWCAP2_AVAIL.
- References: <1372367189 dot 3162 dot 8 dot camel at localhost dot localdomain>
> This is a stub in patch which leaves dl_hwcap2 out of GLRO unless
> HWCAP2_AVAIL is (1).
I'm not sure it's worthwhile to conditionalize it this way. The cost of
the support when it's unused is 8 bytes in an internal data structure and
one extra case/load/store in the auxv-reading code.
> I realize I need to fix the ChangeLog entries to be properly ports/
> specific on the actual check-in (they're all in ChangeLog in the
> commit). I'll do that on my next check-in.
You also need to use [...] syntax for #if conditions.
> + /* Handle in a more sophisticated manner if HWCAP2 is supported. */
> + if (type == AT_HWCAP2)
> + return 0;
This is wrong. It should return -1 if it's not printing out the info
itself, so the generic code will print it in hex. As you have it, the
AT_HWCAP2 entry will be eaten when present.
Thanks,
Roland