Skip to content

Commit

Permalink
ld preload blocked from glibc
Browse files Browse the repository at this point in the history
  • Loading branch information
sulincix committed Jun 10, 2024
1 parent 9682355 commit 2ab407c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
20 changes: 20 additions & 0 deletions sys/base/glibc/data/disable-ld-preload.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
diff --git a/elf/rtld.c b/elf/rtld.c
index e9525ea9..0879caa1 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -1836,15 +1836,6 @@ dl_main (const ElfW(Phdr) *phdr,
struct link_map **preloads = NULL;
unsigned int npreloads = 0;

- if (__glibc_unlikely (state.preloadlist != NULL))
- {
- RTLD_TIMING_VAR (start);
- rtld_timer_start (&start);
- npreloads += handle_preload_list (state.preloadlist, main_map,
- "LD_PRELOAD");
- rtld_timer_accum (&load_time, start);
- }
-
if (__glibc_unlikely (state.preloadarg != NULL))
{
RTLD_TIMING_VAR (start);
6 changes: 6 additions & 0 deletions sys/base/glibc/ympbuild
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ source=("https://ftp.gnu.org/gnu/glibc/glibc-${version}.tar.xz"
'data/glibc.sysconf'
'scripts/locale-gen'
'scripts/revdep-rebuild'
'data/disable-ld-preload.patch'
'data/tr_TR'
)
md5sums=('be81e87f72b5ea2c0ffe2bedfeb680c6'
Expand All @@ -27,6 +28,7 @@ md5sums=('be81e87f72b5ea2c0ffe2bedfeb680c6'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
)
uses=(multilib)
group=(sys.base)
Expand All @@ -36,6 +38,10 @@ export CXXFLAGS="-O2 ${debug:+-g} -s -mtune=generic -DTURKMAN"

cd "$name-$version"

prepare(){
patch -Np1 -i ../disable-ld-preload.patch
}

setup(){
opts=(
--prefix=/usr
Expand Down

0 comments on commit 2ab407c

Please sign in to comment.