summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/microblaze/config.mk3
-rw-r--r--arch/microblaze/cpu/u-boot.lds6
2 files changed, 6 insertions, 3 deletions
diff --git a/arch/microblaze/config.mk b/arch/microblaze/config.mk
index 96c39b1278b..de5b97e719c 100644
--- a/arch/microblaze/config.mk
+++ b/arch/microblaze/config.mk
@@ -9,6 +9,9 @@
CONFIG_STANDALONE_LOAD_ADDR ?= 0x80F00000
PLATFORM_CPPFLAGS += -ffixed-r31 -D__microblaze__
+PLATFORM_CPPFLAGS += -fdata-sections -ffunction-sections
+
+LDFLAGS_FINAL += --gc-sections
ifeq ($(CONFIG_SPL_BUILD),)
PLATFORM_CPPFLAGS += -fPIC
diff --git a/arch/microblaze/cpu/u-boot.lds b/arch/microblaze/cpu/u-boot.lds
index 92826433498..5dc09dbad2d 100644
--- a/arch/microblaze/cpu/u-boot.lds
+++ b/arch/microblaze/cpu/u-boot.lds
@@ -14,7 +14,7 @@ SECTIONS
{
__text_start = .;
arch/microblaze/cpu/start.o (.text)
- *(.text)
+ *(.text*)
__text_end = .;
}
@@ -28,7 +28,7 @@ SECTIONS
.data ALIGN(0x4):
{
__data_start = .;
- *(.data)
+ *(.data*)
__data_end = .;
}
@@ -51,7 +51,7 @@ SECTIONS
__bss_start = .;
*(.sbss)
*(.scommon)
- *(.bss)
+ *(.bss*)
*(COMMON)
. = ALIGN(4);
__bss_end = .;