xref: /linux/tools/objtool/tests/generic/test-missing-checksum.sh (revision ade23d75deb3c679760c3f0f33d9b8d8ffa9f963)
1#!/bin/bash
2# SPDX-License-Identifier: GPL-2.0
3#
4# Without .discard.sym_checksum there is nothing to compare; concluding that
5# nothing changed would be worse than failing.
6
7. "$(dirname "$0")/../lib.sh"
8
9setup
10build_pair basic.c
11
12( cd "$workdir" && "$OBJTOOL" klp diff orig.o patched.o out.o ) \
13	> "$workdir/diff.log" 2>&1 && fail "klp diff accepted an unchecksummed object"
14
15grep -q 'sym_checksum' "$workdir/diff.log" ||
16	fail "expected a complaint about the checksum section, got: $(tail -1 "$workdir/diff.log")"
17
18pass "unchecksummed input rejected"
19