[PATCH v3 04/12] xtensa: Define PLATFORM_ELFFLAGS

Jiaxun Yang jiaxun.yang at flygoat.com
Tue Jun 18 15:56:04 CEST 2024


u-boot.elf target requires it to work.

Tested-by: Max Filippov <jcmvbkbc at gmail.com>
Signed-off-by: Jiaxun Yang <jiaxun.yang at flygoat.com>
---
v2:
	- Concerning big endian CPU

Note: CONFIG_SYS_BIG_ENDIAN will never be set for xtensa
for now, but as we don't have big endian headers for xtensa
core either I think it's fine for now. This will be improved
after my arm64be work get merged.
---
 arch/xtensa/config.mk | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/xtensa/config.mk b/arch/xtensa/config.mk
index b0809999e403..200b66f85047 100644
--- a/arch/xtensa/config.mk
+++ b/arch/xtensa/config.mk
@@ -7,3 +7,9 @@ PLATFORM_CPPFLAGS += -D__XTENSA__ -mlongcalls -mforce-no-pic \
 		     -ffunction-sections -fdata-sections
 
 LDFLAGS_FINAL += --gc-sections
+
+ifeq ($(CONFIG_SYS_BIG_ENDIAN),y)
+PLATFORM_CPPFLAGS += -B xtensa -O elf32-xtensa-be
+else
+PLATFORM_ELFFLAGS += -B xtensa -O elf32-xtensa-le
+endif

-- 
2.43.0



More information about the U-Boot mailing list