mirror of
https://github.com/zeldaret/oot.git
synced 2024-11-11 11:49:24 +00:00
17 lines
561 B
Bash
17 lines
561 B
Bash
|
#!/bin/sh
|
||
|
|
||
|
NM=$1
|
||
|
ELF=$2
|
||
|
|
||
|
# dmadata_syms contents look like:
|
||
|
# ffffffff80015850 T _dmadataSegmentTextStart
|
||
|
# 00000000 A _dmadataSegmentTextSize
|
||
|
# 00011a40 A _dmadataSegmentRomStart
|
||
|
# ffffffff8001b920 T _dmadataSegmentRoDataEnd
|
||
|
dmadata_syms=`$NM $ELF --no-sort --radix=x --format=bsd | grep dmadata`
|
||
|
|
||
|
_dmadataSegmentRomStart=`echo "$dmadata_syms" | grep '\b_dmadataSegmentRomStart\b' | cut -d' ' -f1`
|
||
|
_dmadataSegmentRomEnd=` echo "$dmadata_syms" | grep '\b_dmadataSegmentRomEnd\b' | cut -d' ' -f1`
|
||
|
|
||
|
echo 0x"$_dmadataSegmentRomStart"-0x"$_dmadataSegmentRomEnd"
|