xref: /linux/tools/objtool/tests/generic/test-changed-data.sh (revision 5b6dca02b3e2254d2fd5706d76d7ab4610a67296)
1*b229562cSPuranjay Mohan#!/bin/bash
2*b229562cSPuranjay Mohan# SPDX-License-Identifier: GPL-2.0
3*b229562cSPuranjay Mohan#
4*b229562cSPuranjay Mohan# Livepatching replaces functions, not data.  A changed data symbol must be
5*b229562cSPuranjay Mohan# rejected.
6*b229562cSPuranjay Mohan
7*b229562cSPuranjay Mohan. "$(dirname "$0")/../lib.sh"
8*b229562cSPuranjay Mohan
9*b229562cSPuranjay Mohansetup
10*b229562cSPuranjay Mohanbuild_pair changed_data.c
11*b229562cSPuranjay Mohanrun_diff 255
12*b229562cSPuranjay Mohan
13*b229562cSPuranjay Mohandiff_log | grep -q 'changed data: klp_test_data' ||
14*b229562cSPuranjay Mohan	fail "expected rejection, got: $(diff_log | tail -1)"
15*b229562cSPuranjay Mohan[ -e "$workdir/out.o" ] &&
16*b229562cSPuranjay Mohan	fail "output object produced for a rejected input"
17*b229562cSPuranjay Mohan
18*b229562cSPuranjay Mohanpass "changed data symbol rejected"
19