This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch] Make libstdc++'s abi_check more robust against readelf output format
- From: Ollie Wild <aaw at google dot com>
- To: Simon Baldwin <simonb at google dot com>
- Cc: gcc-patches at gcc dot gnu dot org, ppluzhnikov at google dot com, libstdc++ at gcc dot gnu dot org, c at google dot com
- Date: Fri, 20 May 2011 10:10:48 -0500
- Subject: Re: [Patch] Make libstdc++'s abi_check more robust against readelf output format
- References: <20110520150530.1A9281DA1DE@topo.tor.corp.google.com>
Ok, for google/integration. Please integrate to google/main and
google/gcc-4_6 as well.
Ollie
On Fri, May 20, 2011 at 10:05 AM, Simon Baldwin <simonb@google.com> wrote:
>
> Make libstdc++'s abi_check more robust against readelf output format.
>
> libstdc++-abi/abi_check in the libstdc++-v3 testsuite relies on a fixed
> number of space separated fields in readelf output. ?However, the field
> count for readelf output can vary where the library contains OS or processor
> specific bindings, or other unknown bindings.
>
> This patch replaces the strings that readelf outputs for such bindings
> with alternative strings that use underscores in place of space. ?It
> preserves the count of fields for such cases, and allows the awk statement
> that follows to find the desired field correctly with $n.
>
> OK for trunk?
>
> libstdc++-v3/ChangeLog:
> 2011-05-20 ?Simon Baldwin ?<simonb@google.com>
>
> ? ? ? ?* scripts/extract_symvers.in: Handle processor/OS specific or
> ? ? ? ?unknown symbol binding strings from readelf.
>
>
> Index: libstdc++-v3/scripts/extract_symvers.in
> ===================================================================
> --- libstdc++-v3/scripts/extract_symvers.in ? ? (revision 173951)
> +++ libstdc++-v3/scripts/extract_symvers.in ? ? (working copy)
> @@ -52,6 +52,9 @@ SunOS)
> ? ${readelf} ${lib} |\
> ? sed -e 's/ \[<other>: [A-Fa-f0-9]*\] //' -e '/\.dynsym/,/^$/p;d' |\
> ? egrep -v ' (LOCAL|UND) ' |\
> + ?sed -e 's/ <processor specific>: / <processor_specific>:_/g' |\
> + ?sed -e 's/ <OS specific>: / <OS_specific>:_/g' |\
> + ?sed -e 's/ <unknown>: / <unknown>:_/g' |\
> ? awk '{ if ($4 == "FUNC" || $4 == "NOTYPE")
> ? ? ? ? ? ?printf "%s:%s\n", $4, $8;
> ? ? ? ? ?else if ($4 == "OBJECT" || $4 == "TLS")