Docs: Update CN trans for build-system.rst

This commit is contained in:
Mo Fei Fei
2022-10-08 15:49:34 +08:00
committed by morris
parent c61910c267
commit b03cc11a92
2 changed files with 18 additions and 3 deletions
+3 -3
View File
@@ -654,7 +654,7 @@ Take care when adding configuration values in this file, as they will be include
``project_include.cmake`` files are used inside ESP-IDF, for defining project-wide build features such as ``esptool.py`` command line arguments and the ``bootloader`` "special app".
Wrappers to redefine or extend existing functions
Wrappers to Redefine or Extend Existing Functions
-------------------------------------------------
Thanks to the linker's wrap feature, it is possible to redefine or extend the behavior of an existing ESP-IDF function. To do so, you will need to provide the following CMake declaration in your project's ``CMakeLists.txt`` file:
@@ -663,11 +663,11 @@ Thanks to the linker's wrap feature, it is possible to redefine or extend the be
target_link_libraries(${COMPONENT_LIB} INTERFACE "-Wl,--wrap=function_to_redefine")
Where ``function_to_redefine`` is the name of the function to redefine or extend. This option will let the linker replace all the calls to ``function_to_redefine`` functions in the binary libraries be changed to calls to ``__wrap_function_to_redefine`` function. Thus, you must define this new symbol in your application.
Where ``function_to_redefine`` is the name of the function to redefine or extend. This option will let the linker replace all the calls to ``function_to_redefine`` functions in the binary libraries with calls to ``__wrap_function_to_redefine`` function. Thus, you must define this new symbol in your application.
The linker will provide a new symbol named ``__real_function_to_redefine`` which points to the former implementation of the function to redefine. It can be called from the new implementation, making it an extension of the former one.
This mechanism is shown in the example :example:`build_system/wrappers`. Check its ``README.md`` for more details.
This mechanism is shown in the example :example:`build_system/wrappers`. Check :idf_file:`examples/build_system/wrappers/README.md` for more details.
.. _config_only_component: