| 1 | #!/bin/bash |
| 2 | # SPDX-License-Identifier: GPL-2.0 |
| 3 | # |
| 4 | # A text annotation on an instruction inside an alternative's replacement must |
| 5 | # be carried into the patch. |
| 6 | # |
| 7 | # The kernel annotates replacement code wherever objtool has to be told |
| 8 | # something about it -- a retpoline-safe indirect branch, a deliberately absent |
| 9 | # ENDBR. Two things made klp diff drop those annotations: |
| 10 | # |
| 11 | # - replacement code has no real symbol, so objtool invents a NOTYPE fake |
| 12 | # one, and the extraction only kept references to FUNC symbols; |
| 13 | # - .discard.annotate_insn was processed before .altinstructions, so the |
| 14 | # replacement it referenced had no clone to point at yet. |
| 15 | # |
| 16 | # Nothing fails at build time when the annotation goes missing. It surfaces |
| 17 | # later as objtool warning about, or rejecting, the patched code it was there |
| 18 | # to explain. |
| 19 | # |
| 20 | # Fixed by 62a7a01fde87 ("objtool/klp: Fix extraction of text annotations for |
| 21 | # alternatives"). |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | # The annotation has to survive, and to still name the replacement. Checking |
| 34 | # only the section would pass on an entry whose relocation was dropped. |
| 35 | |
| 36 | |
| 37 | |
| 38 |