Commit 6baf85b3 authored by Sathees Balya's avatar Sathees Balya
Browse files

romlib: Allow patching of romlib functions



This change allows patching of functions in the
romlib. This can be done by adding "patch" at the
end of the jump table entry for the function that
needs to be patched in the file jmptbl.i.
Functions patched in the jump table list will be
built as part of the BL image and the romlib
version will not be used

Change-Id: Iefb200cb86e2a4b61ad3ee6180d3ecc39bad537f
Signed-off-by: default avatarSathees Balya <sathees.balya@arm.com>
parent c3859557
...@@ -31,7 +31,7 @@ do ...@@ -31,7 +31,7 @@ do
done done
awk '{sub(/[:blank:]*#.*/,"")} awk '{sub(/[:blank:]*#.*/,"")}
!/^$/ {print $1*4, $2, $3}' "$@" | !/^$/ && !/\\tpatch$/ {print $1*4, $2, $3}' "$@" |
while read idx lib sym while read idx lib sym
do do
file=$build/${lib}_$sym file=$build/${lib}_$sym
......
...@@ -3,6 +3,10 @@ ...@@ -3,6 +3,10 @@
# #
# SPDX-License-Identifier: BSD-3-Clause # SPDX-License-Identifier: BSD-3-Clause
# #
# Format:
# index lib function [patch]
# Add "patch" at the end of the line to patch a function. For example:
# 14 mbedtls mbedtls_memory_buffer_alloc_init patch
0 rom rom_lib_init 0 rom rom_lib_init
1 fdt fdt_getprop_namelen 1 fdt fdt_getprop_namelen
......
...@@ -338,7 +338,7 @@ LDPATHS = -L${LIB_DIR} ...@@ -338,7 +338,7 @@ LDPATHS = -L${LIB_DIR}
LDLIBS += -l$(1) LDLIBS += -l$(1)
ifeq ($(USE_ROMLIB),1) ifeq ($(USE_ROMLIB),1)
LDLIBS := -lwrappers -lc LIBWRAPPER = -lwrappers
endif endif
all: ${LIB_DIR}/lib$(1).a all: ${LIB_DIR}/lib$(1).a
...@@ -402,7 +402,7 @@ else ...@@ -402,7 +402,7 @@ else
endif endif
$$(Q)$$(LD) -o $$@ $$(TF_LDFLAGS) $$(LDFLAGS) -Map=$(MAPFILE) \ $$(Q)$$(LD) -o $$@ $$(TF_LDFLAGS) $$(LDFLAGS) -Map=$(MAPFILE) \
--script $(LINKERFILE) $(BUILD_DIR)/build_message.o \ --script $(LINKERFILE) $(BUILD_DIR)/build_message.o \
$(OBJS) $(LDPATHS) $(LDLIBS) $(BL_LIBS) $(OBJS) $(LDPATHS) $(LIBWRAPPER) $(LDLIBS) $(BL_LIBS)
$(DUMP): $(ELF) $(DUMP): $(ELF)
$${ECHO} " OD $$@" $${ECHO} " OD $$@"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment