golang/go

cmd/asm, runtime: textflag for CABI

Open

#21.004 geöffnet am 13. Juli 2017

Auf GitHub ansehen
 (3 Kommentare) (1 Reaktion) (0 zugewiesene Personen)Go (19.008 Forks)batch import
NeedsFixhelp wanted

Repository-Metriken

Stars
 (133.883 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

The runtime assembly code includes many functions that are called from outside the runtime and are called with the C ABI. This means the functions first have to save callee-saved registers manually.

For example, see runtime·sigtramp in sys_linux_*.s.

Once after diagnosing a callee-save error, I failed to save all the callee-save registers. This meant months later, @aclements had to go through the same long debugging session. We could make this more robust (and potentially make our assembly a bit easier to read) by adding a CABI text flag, and have the assembler insert code for saving and restoring registers.

cc @ianlancetaylor

Contributor Guide