Skip to content

Commit fd4cc68

Browse files
committed
Undo redundant workarounds
1 parent b55cd21 commit fd4cc68

File tree

3 files changed

+1
-38
lines changed

3 files changed

+1
-38
lines changed

Makefile

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ DEBUG_UART?=0
2525
LIBS=
2626
SIGN_ALG=
2727
OBJCOPY_FLAGS=
28-
OBJCOPY_BIN_FLAGS=
2928
BIG_ENDIAN?=0
3029
USE_CLANG?=0
3130
ifeq ($(USE_CLANG),1)
@@ -199,13 +198,6 @@ ifeq ($(USE_GCC_HEADLESS),1)
199198
OBJCOPY_FLAGS+=--gap-fill $(FILL_BYTE)
200199
endif
201200

202-
ifeq ($(ARCH),ARM)
203-
ifeq ($(USE_CLANG),1)
204-
ifneq ($(TZEN),1)
205-
OBJCOPY_BIN_FLAGS+=$(CLANG_ARM_OBJCOPY_FLASH_FLAGS_BOOT)
206-
endif
207-
endif
208-
endif
209201
ifeq ($(TARGET),ti_hercules)
210202
LSCRIPT_FLAGS+=--run_linker $(LSCRIPT)
211203
endif
@@ -335,21 +327,7 @@ wolfboot.efi: wolfboot.elf
335327

336328
wolfboot.bin: wolfboot.elf
337329
@echo "\t[BIN] $@"
338-
ifeq ($(USE_CLANG),1)
339-
ifeq ($(TZEN),1)
340-
$(Q)last_load="$$($(CROSS_COMPILE)readelf -Wl $< | awk '/ LOAD / { line = $$0 } END { print line }')"; \
341-
set -- $$last_load; \
342-
last_phys=$$(printf '%d' $$4); \
343-
last_filesz=$$(printf '%d' $$5); \
344-
padded_filesz=$$((($$last_filesz + 0xff) & ~0xff)); \
345-
pad_to=$$((last_phys + padded_filesz)); \
346-
$(OBJCOPY) $(OBJCOPY_FLAGS) $(OBJCOPY_BIN_FLAGS) --pad-to=$$(printf '0x%x' $$pad_to) -O binary $< $@
347-
else
348-
$(Q)$(OBJCOPY) $(OBJCOPY_FLAGS) $(OBJCOPY_BIN_FLAGS) -O binary $^ $@
349-
endif
350-
else
351-
$(Q)$(OBJCOPY) $(OBJCOPY_FLAGS) $(OBJCOPY_BIN_FLAGS) -O binary $^ $@
352-
endif
330+
$(Q)$(OBJCOPY) $(OBJCOPY_FLAGS) -O binary $^ $@
353331
@echo
354332
@echo "\t[SIZE]"
355333
$(Q)$(SIZE) wolfboot.elf

arch.mk

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,12 +1301,6 @@ ifeq ($(USE_CLANG),1)
13011301
CFLAGS+=-Wno-unknown-attributes -Wno-error=unknown-attributes
13021302
CFLAGS+=-fno-unwind-tables -fno-asynchronous-unwind-tables
13031303
LSCRIPT_FLAGS+=-T $(abspath $(WOLFBOOT_ROOT)/hal/clang-discard.ld)
1304-
# Clang-built ARM raw images may otherwise expand ELF loadable gaps into
1305-
# oversized binaries on some targets. Keep the section selection scoped to
1306-
# the Clang workaround paths only.
1307-
CLANG_ARM_OBJCOPY_FLASH_FLAGS_BASE:=-j .text -j .edidx
1308-
CLANG_ARM_OBJCOPY_FLASH_FLAGS_BOOT:=$(CLANG_ARM_OBJCOPY_FLASH_FLAGS_BASE) -j .ramcode -j .keystore -j .gnu.sgstubs
1309-
CLANG_ARM_OBJCOPY_FLASH_FLAGS_APP:=$(CLANG_ARM_OBJCOPY_FLASH_FLAGS_BASE)
13101304
endif
13111305

13121306
ifeq ($(USE_GCC),1)

test-app/Makefile

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -105,15 +105,6 @@ OBJCOPY_FLAGS+=--gap-fill $(FILL_BYTE)
105105
OBJCOPY_IMAGE_FLAGS:=
106106

107107
ifeq ($(USE_CLANG),1)
108-
# Clang-built ARM ELFs can keep RAM sections as loadable segments, and raw
109-
# objcopy output then expands the flash-to-RAM gap into a huge sparse image.
110-
# The app image only needs the flash-backed output sections. TrustZone
111-
# non-secure apps also need the flash-backed .data load image.
112-
ifeq ($(TZEN),1)
113-
OBJCOPY_IMAGE_FLAGS+=-j .text -j .edidx -j .data
114-
else
115-
OBJCOPY_IMAGE_FLAGS+=$(CLANG_ARM_OBJCOPY_FLASH_FLAGS_APP)
116-
endif
117108
# Clang doesn't emit empty .data/.bss sections in object files (GCC does).
118109
# GNU ld mishandles AT() for output sections with no matching input sections,
119110
# setting LMA=VMA instead of the specified flash address.

0 commit comments

Comments
 (0)