wabt
                                
                                 wabt copied to clipboard
                                
                                    wabt copied to clipboard
                            
                            
                            
                        wabbt - ReadBinaryIR() -> WriteBinaryModule() -> emnm output.o :: error: output.o: out of order section type: 0
I've been debugging my transformation, and I've found if I read in a wasm file with ReadBinaryIR() and then just write it back with no modification using WriteBinaryModule(), then I can't link with the new object. E.g. emnm gives and error, out of order section type:0
Interestingly, if I then do:
wasm2wat output.o -o output.wat
wat2wasm --relocatable output.wat -o output.o
Then the object thats been translated by wasm2wat and back works correctly.
I've tried to look if there are some options I'm missing in the binary reader/writer but I can't see a difference between what wasm2wat does.
Does anyone know what I might be missing?
Ok I've now found that:
s_write_binary_options.write_debug_names = true
Causes this issue.