From 969d21aa2bf474d9c5c80a64de1a9fe0e17e31b2 Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Thu, 14 Oct 2021 15:57:36 +0800
Subject: [PATCH] nativesdk-libcap: Raise the size of arrays containing dl
 paths

This patch puts the dynamic loader path in the binaries, SYSTEM_DIRS strings
and lengths as well as ld.so.cache path in the dynamic loader to specific
sections in memory. The sections that contain paths have been allocated a 4096
byte section, which is the maximum path length in linux. This will allow the
relocating script to parse the ELF binary, detect the section and easily replace
the strings in a certain path.

Upstream-Status: Inappropriate [SDK specific]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 libcap/execable.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libcap/execable.h b/libcap/execable.h
index a68ea24..60d3853 100644
--- a/libcap/execable.h
+++ b/libcap/execable.h
@@ -34,7 +34,7 @@ extern const int _IO_stdin_used;
 const int _IO_stdin_used __attribute__((weak)) = 131073;
 #endif /* def __GLIBC__ */
 
-const char __execable_dl_loader[] __attribute((section(".interp"))) =
+const char __execable_dl_loader[4096] __attribute((section(".interp"))) =
     SHARED_LOADER ;
 
 static void __execable_parse_args(int *argc_p, char ***argv_p)
