Makefile.postlink 963 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. # SPDX-License-Identifier: GPL-2.0
  2. # ===========================================================================
  3. # Post-link s390 pass
  4. # ===========================================================================
  5. #
  6. # 1. Separate relocations from vmlinux into relocs.S.
  7. # 2. Strip relocations from vmlinux.
  8. PHONY := __archpost
  9. __archpost:
  10. -include include/config/auto.conf
  11. include $(srctree)/scripts/Kbuild.include
  12. CMD_RELOCS=arch/s390/tools/relocs
  13. OUT_RELOCS = arch/s390/boot
  14. quiet_cmd_relocs = RELOCS $(OUT_RELOCS)/relocs.S
  15. cmd_relocs = \
  16. mkdir -p $(OUT_RELOCS); \
  17. $(CMD_RELOCS) $@ > $(OUT_RELOCS)/relocs.S
  18. quiet_cmd_strip_relocs = RSTRIP $@
  19. cmd_strip_relocs = \
  20. $(OBJCOPY) --remove-section='.rel.*' --remove-section='.rel__*' \
  21. --remove-section='.rela.*' --remove-section='.rela__*' $@
  22. vmlinux: FORCE
  23. $(call cmd,relocs)
  24. $(call cmd,strip_relocs)
  25. clean:
  26. @rm -f $(OUT_RELOCS)/relocs.S
  27. PHONY += FORCE clean
  28. FORCE:
  29. .PHONY: $(PHONY)