Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

000002c: error: invalid section code: 12 #1955

Closed
xhorak opened this issue Aug 11, 2022 · 3 comments
Closed

000002c: error: invalid section code: 12 #1955

xhorak opened this issue Aug 11, 2022 · 3 comments

Comments

@xhorak
Copy link

xhorak commented Aug 11, 2022

The wasm2wat works fine, but wasm2c returns:
000002c: error: invalid section code: 12
Full output:
wasm2wat:

(module
  (import "env" "__linear_memory" (memory (;0;) 1))
  (data $_ZN5woff210kKnownTagsE (i32.const 0) "pamcdaehaehhxtmhpxameman2/SOtsop tvcmgpffylgacolperp FFCGROVTDBECLBEpsagxmdhnrekHSTLTLCPXMDVaehvxtmvESABFEDGSOPGBUSGCSBEFTSJHTAMTDBCCLBCRLOCLAPC GVSxibstncaravatadbcolbnlsbravccsdftaefxtmfravfravgytshtsujracltromxromdbpoporpkartfpaZfliStalGcolGtaeFlliS"))
wasm2c -v table_tags.wasm
BeginModule(version: 1)
  BeginImportSection(24)
    OnImportCount(1)
    OnImport(index: 0, kind: memory, module: "env", field: "__linear_memory")
    OnImportMemory(import_index: 0, memory_index: 0, initial: 1)
  EndImportSection
000002c: error: invalid section code: 12

What could be the problem here?

@kripken
Copy link
Member

kripken commented Aug 11, 2022

Section 12 is "DataCount", which I guess wasm2c does not support yet. That section is emitted in binaries that use bulk memory, and in wasm object files. (For wasm object files, you can link them using wasm-ld to a proper wasm executable before running them in wasm2c.)

@keithw
Copy link
Member

keithw commented Aug 11, 2022

FWIW, there is a pending PR to support bulk memory operations in wasm2c (#1877) that you are welcome to try.

@keithw
Copy link
Member

keithw commented Aug 14, 2022

(Closing as answered.)

@keithw keithw closed this as completed Aug 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants