kit

kit
git clone https://git.ryansepassi.com/git/kit.git
Log | Files | Refs | README

05-strip-debug-rv64.sh (590B)


      1 # rv64 cross-compile: --strip-debug drops every KIT_SEC_DEBUG section
      2 # but leaves the symbol table intact. Mirrors 01-strip-debug for ELF/rv64.
      3 
      4 cat > smoke.c <<'EOF'
      5 int helper(void) { return 42; }
      6 int main(void) { return helper(); }
      7 EOF
      8 "$KIT" cc -target riscv64-linux -g -c smoke.c -o smoke.o
      9 "$KIT" strip --strip-debug smoke.o -o smoke.stripped.o
     10 
     11 echo "== sections =="
     12 "$KIT" objdump -h smoke.stripped.o | awk '/^ *[0-9]+ /{print $2}' | grep -E '^\.' | sort
     13 echo "== symbols =="
     14 "$KIT" objdump -t smoke.stripped.o | awk '$NF ~ /^[a-z_]/{print $NF}' | grep -E '^(helper|main)$' | sort