Re: [go-nuts] Is it possible to compile a Go program without jump tables ?

2024-11-28 Thread Ian Lance Taylor
On Thu, Nov 28, 2024, 1:13 AM 'Karolina GORNA' via golang-nuts < golang-nuts@googlegroups.com> wrote: > > @Ian, ok I understand thank you. I am working on Go binary analysis and > this feature would help a lot. Out of curiosity, why do you want to do binary analysis on a program if you can ask f

Re: [go-nuts] Is it possible to compile a Go program without jump tables ?

2024-11-28 Thread 'Keith Randall' via golang-nuts
On Thursday, November 28, 2024 at 4:38:49 PM UTC-8 Lin Lin wrote: I assume you can rewrite the code from switch to if/else before compiling with go/ast package. If that is not your case, hacking the go compiler is a harder solution, you probably don't want to do that. On Thu, 28 Nov 2024 at 1

Re: [go-nuts] Is it possible to compile a Go program without jump tables ?

2024-11-28 Thread Lin Lin
I assume you can rewrite the code from switch to if/else before compiling with go/ast package. If that is not your case, hacking the go compiler is a harder solution, you probably don't want to do that. On Thu, 28 Nov 2024 at 17:12, 'Karolina GORNA' via golang-nuts < golang-nuts@googlegroups.com>

[go-nuts] Re: zero in the new unique package

2024-11-28 Thread 'Константин Иванов' via golang-nuts
Hello. May be because all zero-size values have the same pointer: https://go.dev/play/p/n0dKQFN2EpR Because the values have no memory location. четверг, 28 ноября 2024 г. в 14:21:06 UTC+3, Jochen Voss: > Dear all, > > I am looking at the source code for the new "unique" package (just out of >

[go-nuts] zero in the new unique package

2024-11-28 Thread Jochen Voss
Dear all, I am looking at the source code for the new "unique" package (just out of curiosity). One thing I did not understand: why is `zero` defined to be an `uintptr`? https://cs.opensource.google/go/go/+/master:src/unique/handle.go;l=16 My understanding is the `zero` variable just provides a

Re: [go-nuts] Is it possible to compile a Go program without jump tables ?

2024-11-28 Thread 'Karolina GORNA' via golang-nuts
Hello everyone, Thank you @Keith for the suggestion. I tried with *"go build -gcflags='-N -l''"* but I still have jump tables like *"switchD_004010a2::switchdataD_004bc900"* with cases like *switchD_004010a2::caseD_11* ; *switchD_004010a2::caseD_12*... that are in the .rodata section. @Ian,