Inspect supporting strings

After building binaries, you can now inspect strings and symbols in them.

Run the commands on this page from the project directory that contains your compiled binaries:

    

        
        
cd "$HOME/arm64-extension-inspection"

    

A string is printable data stored in the binary. It can reveal a feature check, diagnostic message, or component name without interpreting executable machine code.

Select the example binary, then search its arm64 slice for text related to Scalable Matrix Extension 2 (SME2):

    

        
        
BIN=sme2-positive
strings -arch arm64 "$BIN" | grep -Ei 'FEAT_SME|FEAT_SME2|sme2|matrix|kernel'

    

The output includes the feature-name string:

    

        
        hw.optional.arm.FEAT_SME2

        
    

This text suggests that the program includes code related to SME2. The string can remain in a binary after SME and SME2 instructions were removed. It doesn’t prove that those instructions are present.

Inspect symbols

The nm tool lists symbols in a binary. Symbols associate names with addresses, helping you locate functions and data.

Search the example binary for SME2-related symbols:

    

        
        
nm -arch arm64 "$BIN" | grep -Ei 'sme|sme2|mopa|matrix|kernel'

    

The output is similar to:

    

        
        0000000100004000 D _keep_sme2_kernel
0000000100000424 T _sme2_fixture_kernel

        
    

The T identifies _sme2_fixture_kernel as a defined code symbol. Its address is the start of the function in this build. The leading underscore is the Mach-O naming convention for a C-compatible symbol.

Symbol names can be misleading, and symbols can be removed from a binary. To check which instructions are present, you need disassembly.

Check the string-only control

Run the same searches on the string-only comparison binary:

    

        
        
strings -arch arm64 string-only-control | grep -Ei 'FEAT_SME|FEAT_SME2|sme2|matrix|kernel'
nm -arch arm64 string-only-control | grep -Ei 'sme|sme2|mopa|matrix|kernel'

    

The output is similar to:

    

        
        hw.optional.arm.FEAT_SME2
0000000100000378 T _sme2_string_only_marker

        
    

The comparison binary contains an SME2-related string and symbol, but no SME2 instructions. Finding these names doesn’t mean that SME2 instructions are present. Compiler options and the arm64 architecture label don’t prove this either.

Each check tells you something different about the binary:

FindingWhat it supportsWhat it doesn’t prove
-march optionRequested compiler featuresPresence of SME or SME2 instructions in the compiled binary
arm64 sliceCode compiled for arm64Presence of SME or SME2 instructions
String or symbolNames associated with SME2Presence or runtime execution of SME or SME2 instructions
Decoded SME or SME2 instruction in executable codeInstructions present in the binaryWhether those instructions run or improve performance

What you’ve accomplished and what’s next

You found SME2-related strings and symbols in both the example and comparison binaries.

Next, you’ll disassemble the binaries to check which ones contain SME2 instructions.

Back
Next