diff --git a/linux/Makefile b/linux/Makefile index 45588e7f7..aed0ec9e3 100644 --- a/linux/Makefile +++ b/linux/Makefile @@ -6,6 +6,7 @@ BR2_EXTERNAL_TREE := $(WALLYLINUX)/br2-external-tree LINUX_TESTVECTORS := $(RISCV)/linux-testvectors BUILDROOT_OUTPUTS := Image fw_jump.bin fw_jump.elf rootfs.cpio vmlinux busybox +BUILDROOT_OUTPUTS := $(foreach name, $(BUILDROOT_OUTPUTS), $(IMAGE_DIR)/$(name)) # Device tree files DTS ?= $(wildcard devicetree/*.dts) @@ -51,7 +52,7 @@ build: $(BUILDROOT_OUTPUTS) devicetrees # Build buildroot itself # LD_LIBRARY_PATH must be unset to avoid conflicts between the host and cross compiler -$(BUILDROOT_OUTPUTS): check_environment $(BUILDROOT) +$(BUILDROOT_OUTPUTS) $(IMAGE_DIR): check_environment $(BUILDROOT) bash -c "unset LD_LIBRARY_PATH; $(MAKE) -C $(BUILDROOT)" # Install buildroot to $RISCV @@ -82,7 +83,7 @@ ${LINUX_TESTVECTORS}/%GDB.bin: | $(LINUX_TESTVECTORS) # Generate device tree binaries devicetrees: $(DTB) -$(IMAGE_DIR)/%.dtb: ${WALLYLINUX}/devicetree/%.dts +$(IMAGE_DIR)/%.dtb: ${WALLYLINUX}/devicetree/%.dts | $(IMAGE_DIR) dtc -I dts -O dtb $< > $@ # Create disassembly files @@ -94,9 +95,13 @@ $(DISASSEMBLY_DIR)/rootfs: $(IMAGE_DIR)/rootfs.cpio -cpio -id -D $(DISASSEMBLY_DIR)/rootfs -F $(IMAGE_DIR)rootfs.cpio # Disassemble binaries -objdump_flags = $(if $(findstring .elf,$<),-SD,-S) # Add -D flag for .elf files $(DISASSEMBLY_DIR)/%.objdump: $(IMAGE_DIR)/% | $(DISASSEMBLY_DIR) - riscv64-unknown-elf-objdump $(objdump_flags) $< >> $@ + riscv64-unknown-elf-objdump -S $< >> $@ + $(WALLY)/bin/extractFunctionRadix.sh $@ + +# Disassemble binaries ending in .elf +$(DISASSEMBLY_DIR)/%.objdump: $(IMAGE_DIR)/%.elf | $(DISASSEMBLY_DIR) + riscv64-unknown-elf-objdump -SD $< >> $@ $(WALLY)/bin/extractFunctionRadix.sh $@ # Load wally buildroot configuration diff --git a/linux/br2-external-tree/board/wally/post_image.sh b/linux/br2-external-tree/board/wally/post_image.sh old mode 100644 new mode 100755 index 53544d8b3..e3db7525b --- a/linux/br2-external-tree/board/wally/post_image.sh +++ b/linux/br2-external-tree/board/wally/post_image.sh @@ -2,4 +2,4 @@ # Copy linux and busybox binaries (with symbol info) to images directory cp "$BUILD_DIR"/linux-*/vmlinux "$BINARIES_DIR"/vmlinux -cp "$BUILD_DIR"busybox-*/busybox "$BINARIES_DIR"/busybox +cp "$BUILD_DIR"/busybox-*/busybox "$BINARIES_DIR"/busybox diff --git a/linux/br2-external-tree/configs/wally_defconfig b/linux/br2-external-tree/configs/wally_defconfig index 8759588a7..bdae60a6f 100644 --- a/linux/br2-external-tree/configs/wally_defconfig +++ b/linux/br2-external-tree/configs/wally_defconfig @@ -10,6 +10,7 @@ BR2_GNU_MIRROR="http://ftpmirror.gnu.org" BR2_ENABLE_DEBUG=y BR2_DEBUG_3=y # BR2_STRIP_strip is not set +BR2_PER_PACKAGE_DIRECTORIES=y # BR2_PIC_PIE is not set BR2_SSP_NONE=y BR2_RELRO_NONE=y