#!/bin/sh

# bin2o (heh)
# script to convert a binary data to an elf object file
# (c)2000 Dan Potter
# $Id: bin2o,v 1.4 2001/02/02 22:36:39 bard Exp $

LD=/usr/local/dc/sh-elf/bin/sh-elf-ld

if [ $# == 0 ]; then
	echo usage: $0 \<input file\> \<symbol\> \<output file\>
	exit 0
fi

echo "SECTIONS { .rodata : { _$2 = .; *(.data); _$2_end = .; } }" > /tmp/script.ld
$LD --no-warn-mismatch --format binary --oformat elf32-shl $1 -o $3 -r -EL -T /tmp/script.ld
rm -f /tmp/script.ld

