You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Go assembly & even Go object files seem a world of their own.. So much so that an audit of only that is unlikely to be accepted as a validation of plain hashtree.
It seemed worth asking (in light of the someday audit of this repo and a desire to link to audited code from C, Nim, Python, etc.), if you know a way to maintain a clear chain of custody / do a clean transformation from a Go assembly origin to ELF .o/.so on Linux | Mach-O on OSX | COFF on Windows. (I realize function calling conventions may vary, but this situation seems to have literally only 1 function.)
I could not seem to get gccgo -c (version 12.2.1) to accept hash_amd64.s at all. (Running that did show a couple stray space-after-backslash issues - I can do a PR if you want). Seems gccgo may not even support assembler/OSX/Win in the same way at all, at least 4 years ago according to Ian, the author.
I did find go tool asm -S hash_amd64.s; go tool objdump -gnu hash_amd64.o which emits GAS syntax text as comments { though data interpreted as instructions is not pretty.. :-) }. So, it may be possible to build a fully expanded variant that way & touch up call entry & exit for re-assembly by GAS.
Maybe you have better ideas? Thanks in advance!
The text was updated successfully, but these errors were encountered:
I don't think this is possible at all, the stack structure of the Go runtime is very different than the C ABI and Go takes care of that completely. Notice that there's not even an attempt in the gohashtree library to deal with stack alignment nor to reserve space in the stack to deal with the saving of variables. Go takes care of that. This is one of the biggest complications in hashtree and in its testing across different OSs. I very much doubt one would be able to export any of these assembly into the other by an automated process.
Go assembly & even Go object files seem a world of their own.. So much so that an audit of only that is unlikely to be accepted as a validation of plain
hashtree
.It seemed worth asking (in light of the someday audit of this repo and a desire to link to audited code from C, Nim, Python, etc.), if you know a way to maintain a clear chain of custody / do a clean transformation from a Go assembly origin to ELF .o/.so on Linux | Mach-O on OSX | COFF on Windows. (I realize function calling conventions may vary, but this situation seems to have literally only 1 function.)
I could not seem to get
gccgo -c
(version 12.2.1) to accepthash_amd64.s
at all. (Running that did show a couple stray space-after-backslash issues - I can do a PR if you want). Seems gccgo may not even support assembler/OSX/Win in the same way at all, at least 4 years ago according to Ian, the author.I did find
go tool asm -S hash_amd64.s; go tool objdump -gnu hash_amd64.o
which emits GAS syntax text as comments { though data interpreted as instructions is not pretty.. :-) }. So, it may be possible to build a fully expanded variant that way & touch up call entry & exit for re-assembly by GAS.Maybe you have better ideas? Thanks in advance!
The text was updated successfully, but these errors were encountered: