3 # This script is intended for use with separately linked ROM and RAM.
4 # It creates EITHER a linker script that satisfies references made by RAM
5 # applications to ROM symbols OR a linker script that forces symbols to
6 # be included in a ROM image.
8 # The option "--addrs" causes the RAM linkage script to be generated
9 # and the option "--externs" causes the ROM linkage script to be generated.
12 # make_ld.sh --addrs athos.rom.out athos.rom.symbols > rom.addrs.ld
13 # make_ld.sh --externs athos.rom.symbols > rom.externs.ld
19 echo $progname '{--addrs ROM_ELF_Image | --externs} symbol_file'
23 addr0=`echo $1 | sed 's/
\r$//'`
24 addr=0x`nm $image_file | grep -w $addr0 | cut -d ' ' -f 1`
25 if [ "$addr" != "0x" ]
27 echo PROVIDE \( $addr0 = $addr \)\;
32 echo EXTERN \( $1 \)\;
38 if [ "$script_choice"=="--addrs" ]
43 if [ ! -r "$image_file" ]
45 echo "Cannot read ELF image: $image_file"
49 elif [ "$script_choice"=="--externs" ]
54 if [ ! -r "$symbol_file" ]
56 echo "Cannot read symbol list from: $symbol_file"
63 for i in `cat $symbol_file`