Skip to content

Commit 36dffad

Browse files
committed
[XTENSA] Use preprocessor to generate the linker script for the ELF boot image
Signed-off-by: Marc Gauthier <[email protected]> Signed-off-by: Chris Zankel <[email protected]>
1 parent 6d15d10 commit 36dffad

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

arch/xtensa/boot/boot-elf/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,21 @@ OBJCOPY_ARGS := -O elf32-xtensa-le
1414
endif
1515

1616
export OBJCOPY_ARGS
17+
export CPPFLAGS_boot.lds += -P -C
1718

1819
boot-y := bootstrap.o
1920

2021
OBJS := $(addprefix $(obj)/,$(boot-y))
2122

22-
Image: vmlinux $(OBJS)
23+
Image: vmlinux $(OBJS) arch/$(ARCH)/boot/boot-elf/boot.lds
2324
$(OBJCOPY) --strip-all -R .comment -R .xt.insn -O binary \
2425
vmlinux vmlinux.tmp
2526
$(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
2627
--add-section image=vmlinux.tmp \
2728
--set-section-flags image=contents,alloc,load,load,data \
2829
$(OBJS) $@.tmp
2930
$(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) \
30-
-T $(srctree)/arch/$(ARCH)/boot/boot-elf/boot.ld \
31+
-T arch/$(ARCH)/boot/boot-elf/boot.lds \
3132
-o arch/$(ARCH)/boot/$@.elf $@.tmp
3233
rm -f $@.tmp vmlinux.tmp
3334

arch/xtensa/boot/boot-elf/boot.ld renamed to arch/xtensa/boot/boot-elf/boot.lds.S

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include <asm/variant/core.h>
12
OUTPUT_ARCH(xtensa)
23
ENTRY(_ResetVector)
34

@@ -62,7 +63,7 @@ SECTIONS
6263
_end = .;
6364
_param_start = .;
6465

65-
.ResetVector.text 0xfe000020 :
66+
.ResetVector.text XCHAL_RESET_VECTOR_VADDR :
6667
{
6768
*(.ResetVector.text)
6869
}

0 commit comments

Comments
 (0)