From 5118dcac68c4eadfd6304bb33adde63d062dc07f Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Fri, 15 Oct 2021 14:35:31 -0300 Subject: elf: Fix elf_get_dynamic_info() for bootstrap THe d6d89608ac8c broke powerpc for --enable-bind-now because it turned out that different than patch assumption rtld elf_get_dynamic_info() does require to handle RTLD_BOOTSTRAP to avoid DT_FLAGS and DT_RUNPATH (more specially the GLRO usage which is not reallocate yet). This patch fixes by passing two arguments to elf_get_dynamic_info() to inform that by rtld (bootstrap) or static pie initialization (static_pie_bootstrap). I think using explicit argument is way more clear and burried C preprocessor, and compiler should remove the dead code. I checked on x86_64 and i686 with default options, --enable-bind-now, and --enable-bind-now and --enable--static-pie. I also check on aarch64, armhf, powerpc64, and powerpc with default and --enable-bind-now. --- elf/dl-reloc-static-pie.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'elf/dl-reloc-static-pie.c') diff --git a/elf/dl-reloc-static-pie.c b/elf/dl-reloc-static-pie.c index 40a031f..5b85df8 100644 --- a/elf/dl-reloc-static-pie.c +++ b/elf/dl-reloc-static-pie.c @@ -25,7 +25,6 @@ #include -#define STATIC_PIE_BOOTSTRAP #define RESOLVE_MAP(map, scope, sym, version, flags) map #include "dynamic-link.h" #include "get-dynamic-info.h" @@ -52,7 +51,7 @@ _dl_relocate_static_pie (void) break; } - elf_get_dynamic_info (main_map); + elf_get_dynamic_info (main_map, false, true); # ifdef ELF_MACHINE_BEFORE_RTLD_RELOC ELF_MACHINE_BEFORE_RTLD_RELOC (main_map, main_map->l_info); -- cgit v1.1