1e19db555SDaniel Schwierzeck# 2e19db555SDaniel Schwierzeck# SPDX-License-Identifier: GPL-2.0+ 3e19db555SDaniel Schwierzeck# 4e19db555SDaniel Schwierzeck 5e19db555SDaniel Schwierzecklibs-y += arch/arc/cpu/$(CPU)/ 6e19db555SDaniel Schwierzecklibs-y += arch/arc/lib/ 7*4c8c485aSAlexey Brodkin 8*4c8c485aSAlexey Brodkin# MetaWare debugger doesn't support PIE (position-independent executable) 9*4c8c485aSAlexey Brodkin# so the only way to load U-Boot in MDB is to fake it by: 10*4c8c485aSAlexey Brodkin# 1. Reset PIE flag in ELF header 11*4c8c485aSAlexey Brodkin# 2. Strip all debug information from elf 12*4c8c485aSAlexey Brodkinifdef CONFIG_SYS_LITTLE_ENDIAN 13*4c8c485aSAlexey Brodkin EXEC_TYPE_OFFSET=16 14*4c8c485aSAlexey Brodkinelse 15*4c8c485aSAlexey Brodkin EXEC_TYPE_OFFSET=17 16*4c8c485aSAlexey Brodkinendif 17*4c8c485aSAlexey Brodkin 18*4c8c485aSAlexey Brodkinmdbtrick: u-boot 19*4c8c485aSAlexey Brodkin $(Q)printf '\x02' | dd of=u-boot bs=1 seek=$(EXEC_TYPE_OFFSET) count=1 \ 20*4c8c485aSAlexey Brodkin conv=notrunc &> /dev/null 21*4c8c485aSAlexey Brodkin $(Q)$(CROSS_COMPILE)strip -g u-boot 22