Skip to content

Commit

Permalink
[XTENSA] Use preprocessor to generate the linker script for the ELF b…
Browse files Browse the repository at this point in the history
…oot image

Signed-off-by: Marc Gauthier <[email protected]>
Signed-off-by: Chris Zankel <[email protected]>
  • Loading branch information
czankel committed Feb 14, 2008
1 parent 6d15d10 commit 36dffad
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions arch/xtensa/boot/boot-elf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,21 @@ OBJCOPY_ARGS := -O elf32-xtensa-le
endif

export OBJCOPY_ARGS
export CPPFLAGS_boot.lds += -P -C

boot-y := bootstrap.o

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

Image: vmlinux $(OBJS)
Image: vmlinux $(OBJS) arch/$(ARCH)/boot/boot-elf/boot.lds
$(OBJCOPY) --strip-all -R .comment -R .xt.insn -O binary \
vmlinux vmlinux.tmp
$(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
--add-section image=vmlinux.tmp \
--set-section-flags image=contents,alloc,load,load,data \
$(OBJS) $@.tmp
$(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) \
-T $(srctree)/arch/$(ARCH)/boot/boot-elf/boot.ld \
-T arch/$(ARCH)/boot/boot-elf/boot.lds \
-o arch/$(ARCH)/boot/$@.elf $@.tmp
rm -f $@.tmp vmlinux.tmp

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <asm/variant/core.h>
OUTPUT_ARCH(xtensa)
ENTRY(_ResetVector)

Expand Down Expand Up @@ -62,7 +63,7 @@ SECTIONS
_end = .;
_param_start = .;

.ResetVector.text 0xfe000020 :
.ResetVector.text XCHAL_RESET_VECTOR_VADDR :
{
*(.ResetVector.text)
}
Expand Down

0 comments on commit 36dffad

Please sign in to comment.