Fix spurious match in extract_symvers

Message ID 87plyauqmd.fsf@igel.home
State Accepted
Headers
Series Fix spurious match in extract_symvers |

Checks

Context Check Description
snail/gcc-patch-check success Github commit url

Commit Message

Andreas Schwab Jan. 9, 2024, 9:46 p.m. UTC
  Tighten the regex to find the start of the .dynsym symtab in the readelf
output to avoid matching the section symbol in the normal symtab.

libstdc++-v3:
	* scripts/extract_symvers.in: Require final colon to only match
	.dsynsym in the header of the dynamic symtab.
---
 libstdc++-v3/scripts/extract_symvers.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Jonathan Wakely Jan. 9, 2024, 10:01 p.m. UTC | #1
On Tue, 9 Jan 2024 at 21:47, Andreas Schwab wrote:
>
> Tighten the regex to find the start of the .dynsym symtab in the readelf
> output to avoid matching the section symbol in the normal symtab.

OK, thanks.


>
> libstdc++-v3:
>         * scripts/extract_symvers.in: Require final colon to only match
>         .dsynsym in the header of the dynamic symtab.
> ---
>  libstdc++-v3/scripts/extract_symvers.in | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libstdc++-v3/scripts/extract_symvers.in b/libstdc++-v3/scripts/extract_symvers.in
> index 17f0d31bd1c..6bb951c7145 100755
> --- a/libstdc++-v3/scripts/extract_symvers.in
> +++ b/libstdc++-v3/scripts/extract_symvers.in
> @@ -52,7 +52,7 @@ SunOS)
>    # Omit _DYNAMIC etc. for consistency with extract_symvers.pl, only
>    # present on Solaris.
>    ${readelf} ${lib} |\
> -  sed -e 's/ \[<other>: [A-Fa-f0-9]*\] //' -e '/\.dynsym/,/^$/p;d' |\
> +  sed -e 's/ \[<other>: [A-Fa-f0-9]*\] //' -e '/\.dynsym.*:$/,/^$/p;d' |\
>    sed -e 's/ \[<localentry>: [0-9]*\] //' |\
>    grep -E -v ' (LOCAL|UND) ' |\
>    grep -E -v ' (_DYNAMIC|_GLOBAL_OFFSET_TABLE_|_PROCEDURE_LINKAGE_TABLE_|_edata|_end|_etext)$' |\
> --
> 2.43.0
>
>
> --
> Andreas Schwab, schwab@linux-m68k.org
> GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
> "And now for something completely different."
>
  

Patch

diff --git a/libstdc++-v3/scripts/extract_symvers.in b/libstdc++-v3/scripts/extract_symvers.in
index 17f0d31bd1c..6bb951c7145 100755
--- a/libstdc++-v3/scripts/extract_symvers.in
+++ b/libstdc++-v3/scripts/extract_symvers.in
@@ -52,7 +52,7 @@  SunOS)
   # Omit _DYNAMIC etc. for consistency with extract_symvers.pl, only
   # present on Solaris.
   ${readelf} ${lib} |\
-  sed -e 's/ \[<other>: [A-Fa-f0-9]*\] //' -e '/\.dynsym/,/^$/p;d' |\
+  sed -e 's/ \[<other>: [A-Fa-f0-9]*\] //' -e '/\.dynsym.*:$/,/^$/p;d' |\
   sed -e 's/ \[<localentry>: [0-9]*\] //' |\
   grep -E -v ' (LOCAL|UND) ' |\
   grep -E -v ' (_DYNAMIC|_GLOBAL_OFFSET_TABLE_|_PROCEDURE_LINKAGE_TABLE_|_edata|_end|_etext)$' |\