Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame^] | 1 | From fc60e000169618a4adced845b9462d36ced1efdd Mon Sep 17 00:00:00 2001 |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 2 | From: Hongxu Jia <hongxu.jia@windriver.com> |
| 3 | Date: Thu, 14 Oct 2021 15:57:36 +0800 |
| 4 | Subject: [PATCH] nativesdk-libcap: Raise the size of arrays containing dl |
| 5 | paths |
| 6 | |
| 7 | This patch puts the dynamic loader path in the binaries, SYSTEM_DIRS strings |
| 8 | and lengths as well as ld.so.cache path in the dynamic loader to specific |
| 9 | sections in memory. The sections that contain paths have been allocated a 4096 |
| 10 | byte section, which is the maximum path length in linux. This will allow the |
| 11 | relocating script to parse the ELF binary, detect the section and easily replace |
| 12 | the strings in a certain path. |
| 13 | |
| 14 | Upstream-Status: Inappropriate [SDK specific] |
| 15 | |
| 16 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> |
| 17 | |
| 18 | --- |
| 19 | libcap/execable.h | 2 +- |
| 20 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 21 | |
| 22 | diff --git a/libcap/execable.h b/libcap/execable.h |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame^] | 23 | index fee17b4..5bb0c55 100644 |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 24 | --- a/libcap/execable.h |
| 25 | +++ b/libcap/execable.h |
| 26 | @@ -23,7 +23,7 @@ |
| 27 | #endif |
| 28 | #define __EXECABLE_H |
| 29 | |
| 30 | -const char __execable_dl_loader[] __attribute((section(".interp"))) = |
| 31 | +const char __execable_dl_loader[4096] __attribute((section(".interp"))) = |
| 32 | SHARED_LOADER ; |
| 33 | |
| 34 | static void __execable_parse_args(int *argc_p, char ***argv_p) |