[1/4] alpha: treat STO_ALPHA_STD_GPLOAD as a function in abilist.awk

Message ID 20260906-gm-series1-ifunc-infra-v1-1-d409f053327f@gmail.com (mailing list archive)
State New
Headers
Series alpha: add IFUNC-based multiarch dispatch |

Checks

Context Check Description
redhat-pt-bot/TryBot-apply_patch success Patch applied to master at the time it was sent
linaro-tcwg-bot/tcwg_glibc_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_glibc_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_glibc_check--master-aarch64 success Test passed
linaro-tcwg-bot/tcwg_glibc_check--master-arm success Test passed

Commit Message

Matt Turner Sept. 6, 2026, 7:06 p.m. UTC
  The Alpha ABI defines two st_other values for functions:
  0x80 (STO_ALPHA_NOPV)        - .prologue 0: runs on caller's GP
  0x88 (STO_ALPHA_STD_GPLOAD)  - .prologue 1: standard two-instruction GP load

abilist.awk recognized 0x80 but not 0x88 when classifying a dynamic
symbol of object type as a function.  Symbols like strncat that are weak
aliases of .prologue 1 assembly functions appear as STT_NOTYPE with
st_other=0x88 in the dynamic symbol table and were incorrectly
classified as data.

Add 0x88 to the check so both GP-setup variants are treated as
functions.
---
 scripts/abilist.awk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

H.J. Lu Sept. 7, 2026, 12:21 a.m. UTC | #1
On Mon, Sep 7, 2026 at 3:08 AM Matt Turner <mattst88@gmail.com> wrote:
>
> The Alpha ABI defines two st_other values for functions:
>   0x80 (STO_ALPHA_NOPV)        - .prologue 0: runs on caller's GP
>   0x88 (STO_ALPHA_STD_GPLOAD)  - .prologue 1: standard two-instruction GP load
>
> abilist.awk recognized 0x80 but not 0x88 when classifying a dynamic
> symbol of object type as a function.  Symbols like strncat that are weak
> aliases of .prologue 1 assembly functions appear as STT_NOTYPE with
> st_other=0x88 in the dynamic symbol table and were incorrectly

Why is the alias marked as STT_NOTYPE?

> classified as data.
>
> Add 0x88 to the check so both GP-setup variants are treated as
> functions.
> ---
>  scripts/abilist.awk | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/abilist.awk b/scripts/abilist.awk
> index 7ea1edf8c0..39f63d0803 100644
> --- a/scripts/abilist.awk
> +++ b/scripts/abilist.awk
> @@ -70,8 +70,8 @@ $2 == "g" || $2 == "w" && (NF == 6 || NF == 7 || NF == 8) {
>        type = "O";
>      seen_opd = 1;
>    }
> -  else if (type == "D" && NF == 8 && $7 == "0x80") {
> -    # Alpha functions avoiding plt entry in users
> +  else if (type == "D" && NF == 8 && ($7 == "0x80" || $7 == "0x88")) {
> +    # Alpha functions: 0x80 = STO_ALPHA_NOPV, 0x88 = STO_ALPHA_STD_GPLOAD
>      type = "F";
>      size = "";
>      seen_opd = -1;
>
> --
> 2.54.0
>
  
Matt Turner Sept. 7, 2026, 2:22 a.m. UTC | #2
On Sun, Sep 6, 2026 at 8:22 PM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> On Mon, Sep 7, 2026 at 3:08 AM Matt Turner <mattst88@gmail.com> wrote:
> >
> > The Alpha ABI defines two st_other values for functions:
> >   0x80 (STO_ALPHA_NOPV)        - .prologue 0: runs on caller's GP
> >   0x88 (STO_ALPHA_STD_GPLOAD)  - .prologue 1: standard two-instruction GP load
> >
> > abilist.awk recognized 0x80 but not 0x88 when classifying a dynamic
> > symbol of object type as a function.  Symbols like strncat that are weak
> > aliases of .prologue 1 assembly functions appear as STT_NOTYPE with
> > st_other=0x88 in the dynamic symbol table and were incorrectly
>
> Why is the alias marked as STT_NOTYPE?

Great question -- I think this was papering over a bug in my earlier
series when I was exporting the alias from assembly without a .type
directive.

So this patch is garbage. It should be dropped from the series.
  

Patch

diff --git a/scripts/abilist.awk b/scripts/abilist.awk
index 7ea1edf8c0..39f63d0803 100644
--- a/scripts/abilist.awk
+++ b/scripts/abilist.awk
@@ -70,8 +70,8 @@  $2 == "g" || $2 == "w" && (NF == 6 || NF == 7 || NF == 8) {
       type = "O";
     seen_opd = 1;
   }
-  else if (type == "D" && NF == 8 && $7 == "0x80") {
-    # Alpha functions avoiding plt entry in users
+  else if (type == "D" && NF == 8 && ($7 == "0x80" || $7 == "0x88")) {
+    # Alpha functions: 0x80 = STO_ALPHA_NOPV, 0x88 = STO_ALPHA_STD_GPLOAD
     type = "F";
     size = "";
     seen_opd = -1;