0.0.3 • Published 2 years ago

llvm-objcopy-wasm v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

llvm-objcopy-wasm

A port of llvm-objcopy to WebAssembly.

Feature

  • LLVM 17.0.6
  • Target : AArch64, AMDGPU, ARM, AVR, BPF, Hexagon, Lanai, Mips, MSP430, NVPTX, PowerPC, RISCV, Sparc, SystemZ, WebAssembly, X86, XCore

Install

npm i llvm-objcopy-wasm

Usage

import Module from 'src/llvm-objcopy.mjs'

let handle = await Module()
let args = []
let exitCode = handle.callMain(args)

// See console:

// OVERVIEW: llvm-objcopy tool
//
// USAGE: llvm-objcopy [options] input [output]
//
// ...

Note that the callMain() method is non-reentrant. This means that when you want to call callMain multiple times, you need to do it on a new Module instance.

For more information, see: llvm-objcopy Document

Example

1. Covert input file to binary format in browser

Equivalent command line:

llvm-objcopy -O binary input outout

Try it online: convert-to-binary

Source code: example/convert-to-binary.html

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago