Browse Source

elf2c: emit the entry point of the ELF file too

This will let us get rid of the hard-coded entry point address.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Ronald G. Minnich 7 years ago
parent
commit
13eee98466
1 changed files with 1 additions and 0 deletions
  1. 1 0
      util/src/harvey/cmd/elf2c/elf2c.go

+ 1 - 0
util/src/harvey/cmd/elf2c/elf2c.go

@@ -105,6 +105,7 @@ func main() {
 		// Gen code to stdout. For each file, create an array, a start, and an end variable.
 		w := bufio.NewWriter(os.Stdout)
 		_, file := path.Split(n)
+		fmt.Fprintf(w, "uintptr_t %v_main = %v;\n", n, f.Entry)
 		gencode(w, file, "code", mem, codestart, codeend)
 		gencode(w, file, "data", mem, datastart, dataend)
 		w.Flush()