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