| # SPDX-License-Identifier: GPL-2.0 |
| # =========================================================================== |
| # =========================================================================== |
| # 1. Separate relocations from vmlinux into vmlinux.relocs. |
| # 2. Strip relocations from vmlinux. |
| -include include/config/auto.conf |
| include $(srctree)/scripts/Kbuild.include |
| CMD_RELOCS = arch/x86/tools/relocs |
| OUT_RELOCS = arch/x86/boot/compressed |
| quiet_cmd_relocs = RELOCS $(OUT_RELOCS)/$@.relocs |
| mkdir -p $(OUT_RELOCS); \ |
| $(CMD_RELOCS) $@ > $(OUT_RELOCS)/$@.relocs; \ |
| $(CMD_RELOCS) --abs-relocs $@ |
| quiet_cmd_strip_relocs = RSTRIP $@ |
| $(OBJCOPY) --remove-section='.rel.*' --remove-section='.rel__*' \ |
| --remove-section='.rela.*' --remove-section='.rela__*' $@ |
| # `@true` prevents complaint when there is nothing to be done |
| ifeq ($(CONFIG_X86_NEED_RELOCS),y) |
| @rm -f $(OUT_RELOCS)/vmlinux.relocs |