summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support/libcap/files/0001-nativesdk-libcap-Raise-the-size-of-arrays-containing.patch
blob: c7bf1a8b8c36479b55b6bae188ebd2b774b2666e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
From 794cebc5732908636f22a1d9843fed3ae664899a 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 0bcc5d4..6e2a080 100644
--- a/libcap/execable.h
+++ b/libcap/execable.h
@@ -23,7 +23,7 @@
 #endif
 #define __EXECABLE_H
 
-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)
-- 
2.27.0