What does the word "only" mean in this sentence?

The second interpretation is the correct one.

The stack pointer needs to be saved for non-leaf procedures; for procedures that don't call other procedures, the stack pointer doesn't need to be saved.


Reading this as plain English, without the benefit of years spent as a software engineer, it is an ambiguous sentence and could be interpreted as perfectly sensible either way. So you need to know the context in which the sentence was written (or have some knowledge of the domain) and so could hardly blame anyone without some basic knowledge of low-level programming for wondering.

Your interpretation #2 is the correct one and arguably a much better way to write the sentence to avoid ambiguity.