diff options
author | Andrew Scull | 2022-05-30 10:00:04 +0000 |
---|---|---|
committer | Tom Rini | 2022-06-23 12:58:18 -0400 |
commit | 99e2fbcb69f0759432c4cfa0b6e1afa006f22930 (patch) | |
tree | d19567cb46b803412545c2a770e1590c05ef4a8c /doc | |
parent | 0648b132696532c96c3656876c5b12ac336e1b27 (diff) |
linker_lists: Rename sections to remove . prefix
Rename the sections used to implement linker lists so they begin with
'__u_boot_list' rather than '.u_boot_list'. The double underscore at the
start is still distinct from the single underscore used by the symbol
names.
Having a '.' in the section names conflicts with clang's ASAN
instrumentation which tries to add redzones between the linker list
elements, causing expected accesses to fail. However, clang doesn't try
to add redzones to user sections, which are names with all alphanumeric
and underscore characters.
Signed-off-by: Andrew Scull <ascull@google.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/linker_lists.rst | 22 | ||||
-rw-r--r-- | doc/develop/commands.rst | 4 | ||||
-rw-r--r-- | doc/develop/driver-model/of-plat.rst | 4 |
3 files changed, 15 insertions, 15 deletions
diff --git a/doc/api/linker_lists.rst b/doc/api/linker_lists.rst index 7063fdc8314..3cd447f187d 100644 --- a/doc/api/linker_lists.rst +++ b/doc/api/linker_lists.rst @@ -13,7 +13,7 @@ then the corresponding input section name is :: - .u_boot_list_ + 2_ + @_list + _2_ + @_entry + __u_boot_list_ + 2_ + @_list + _2_ + @_entry and the C variable name is @@ -23,7 +23,7 @@ and the C variable name is This ensures uniqueness for both input section and C variable name. -Note that the names differ only in the first character, "." for the +Note that the names differ only in the characters, "__" for the section and "_" for the variable, so that the linker cannot confuse section and symbol names. From now on, both names will be referred to as @@ -63,11 +63,11 @@ iterated at least once. :: - .u_boot_list_2_array_1 - .u_boot_list_2_array_2_first - .u_boot_list_2_array_2_second - .u_boot_list_2_array_2_third - .u_boot_list_2_array_3 + __u_boot_list_2_array_1 + __u_boot_list_2_array_2_first + __u_boot_list_2_array_2_second + __u_boot_list_2_array_2_third + __u_boot_list_2_array_3 If lists must be divided into sublists (e.g. for iterating only on part of a list), one can simply give the list a name of the form @@ -129,17 +129,17 @@ the compiler cannot update the alignment of the linker_list item. In the first case, an 8-byte 'fill' region is added:: - .u_boot_list_2_driver_2_testbus_drv + __u_boot_list_2_driver_2_testbus_drv 0x0000000000270018 0x80 test/built-in.o 0x0000000000270018 _u_boot_list_2_driver_2_testbus_drv - .u_boot_list_2_driver_2_testfdt1_drv + __u_boot_list_2_driver_2_testfdt1_drv 0x0000000000270098 0x80 test/built-in.o 0x0000000000270098 _u_boot_list_2_driver_2_testfdt1_drv *fill* 0x0000000000270118 0x8 - .u_boot_list_2_driver_2_testfdt_drv + __u_boot_list_2_driver_2_testfdt_drv 0x0000000000270120 0x80 test/built-in.o 0x0000000000270120 _u_boot_list_2_driver_2_testfdt_drv - .u_boot_list_2_driver_2_testprobe_drv + __u_boot_list_2_driver_2_testprobe_drv 0x00000000002701a0 0x80 test/built-in.o 0x00000000002701a0 _u_boot_list_2_driver_2_testprobe_drv diff --git a/doc/develop/commands.rst b/doc/develop/commands.rst index c72d1b0aaad..ede880d248c 100644 --- a/doc/develop/commands.rst +++ b/doc/develop/commands.rst @@ -169,8 +169,8 @@ by writing in u-boot.lds ($(srctree)/board/boardname/u-boot.lds) these .. code-block:: c - .u_boot_list : { - KEEP(*(SORT(.u_boot_list*))); + __u_boot_list : { + KEEP(*(SORT(__u_boot_list*))); } Writing tests diff --git a/doc/develop/driver-model/of-plat.rst b/doc/develop/driver-model/of-plat.rst index 237af38ad4d..b454f7be85e 100644 --- a/doc/develop/driver-model/of-plat.rst +++ b/doc/develop/driver-model/of-plat.rst @@ -707,9 +707,9 @@ Link errors / undefined reference Sometimes dtoc does not find the problem for you, but something is wrong and you get a link error, e.g.:: - :(.u_boot_list_2_udevice_2_spl_test5+0x0): undefined reference to + :(__u_boot_list_2_udevice_2_spl_test5+0x0): undefined reference to `_u_boot_list_2_driver_2_sandbox_spl_test' - /usr/bin/ld: dts/dt-uclass.o:(.u_boot_list_2_uclass_2_misc+0x8): + /usr/bin/ld: dts/dt-uclass.o:(__u_boot_list_2_uclass_2_misc+0x8): undefined reference to `_u_boot_list_2_uclass_driver_2_misc' The first one indicates that the device cannot find its driver. This means that |