public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/maskray/grte] Un-nest an include in dl-reloc-static-pie.c.
@ 2021-08-28  0:31 Fangrui Song
  0 siblings, 0 replies; 3+ messages in thread
From: Fangrui Song @ 2021-08-28  0:31 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=0337af1396cca76149ab4b406d0dbeddcc0d5dca

commit 0337af1396cca76149ab4b406d0dbeddcc0d5dca
Author: Siva Chandra Reddy <sivachandra@google.com>
Date:   Mon Apr 1 11:26:29 2019 -0700

    Un-nest an include in dl-reloc-static-pie.c.
    
    A corresponding adjustment in sysdeps/x86_64/dl-machine.h has also been
    made.

Diff:
---
 elf/dl-reloc-static-pie.c   | 16 ++++++++++++++--
 sysdeps/x86_64/dl-machine.h |  2 +-
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/elf/dl-reloc-static-pie.c b/elf/dl-reloc-static-pie.c
index bd2d516e5d..42d1529094 100644
--- a/elf/dl-reloc-static-pie.c
+++ b/elf/dl-reloc-static-pie.c
@@ -19,7 +19,13 @@
 #if ENABLE_STATIC_PIE
 #include <unistd.h>
 #include <ldsodefs.h>
-#include "dynamic-link.h"
+
+#ifndef NESTING
+# define STATIC_PIE_BOOTSTRAP
+# define BOOTSTRAP_MAP (main_map)
+# define RESOLVE_MAP(sym, version, flags) BOOTSTRAP_MAP
+# include "dynamic-link.h"
+#endif /* n NESTING */
 
 /* Relocate static executable with PIE.  */
 
@@ -28,10 +34,12 @@ _dl_relocate_static_pie (void)
 {
   struct link_map *main_map = _dl_get_dl_main_map ();
 
+#ifdef NESTING
 # define STATIC_PIE_BOOTSTRAP
 # define BOOTSTRAP_MAP (main_map)
 # define RESOLVE_MAP(sym, version, flags) BOOTSTRAP_MAP
 # include "dynamic-link.h"
+#endif /* NESTING */
 
   /* Figure out the run-time load address of static PIE.  */
   main_map->l_addr = elf_machine_load_address ();
@@ -46,7 +54,11 @@ _dl_relocate_static_pie (void)
 
   /* Relocate ourselves so we can do normal function calls and
      data access using the global offset table.  */
-  ELF_DYNAMIC_RELOCATE (main_map, 0, 0, 0);
+  ELF_DYNAMIC_RELOCATE (main_map, 0, 0, 0
+#ifndef NESTING
+                        , main_map
+#endif
+                        );
   main_map->l_relocated = 1;
 }
 #endif
diff --git a/sysdeps/x86_64/dl-machine.h b/sysdeps/x86_64/dl-machine.h
index ea9a2366b2..f2b80df619 100644
--- a/sysdeps/x86_64/dl-machine.h
+++ b/sysdeps/x86_64/dl-machine.h
@@ -309,7 +309,7 @@ elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc,
 # ifndef RTLD_BOOTSTRAP
       const ElfW(Sym) *const refsym = sym;
 # endif
-#if !defined NESTING && defined RTLD_BOOTSTRAP
+#if !defined NESTING && (defined RTLD_BOOTSTRAP || defined STATIC_PIE_BOOTSTRAP)
   struct link_map *sym_map = boot_map;
 #else
       struct link_map *sym_map = RESOLVE_MAP (&sym, version, r_type);


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [glibc/maskray/grte] Un-nest an include in dl-reloc-static-pie.c.
@ 2021-08-28  0:27 Fangrui Song
  0 siblings, 0 replies; 3+ messages in thread
From: Fangrui Song @ 2021-08-28  0:27 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=9debed8dc514f65a6664f6898ae5aac37c33b6b2

commit 9debed8dc514f65a6664f6898ae5aac37c33b6b2
Author: Siva Chandra Reddy <sivachandra@google.com>
Date:   Mon Apr 1 11:26:29 2019 -0700

    Un-nest an include in dl-reloc-static-pie.c.
    
    A corresponding adjustment in sysdeps/x86_64/dl-machine.h has also been
    made.

Diff:
---
 elf/dl-reloc-static-pie.c   | 16 ++++++++++++++--
 sysdeps/x86_64/dl-machine.h |  2 +-
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/elf/dl-reloc-static-pie.c b/elf/dl-reloc-static-pie.c
index bd2d516e5d..42d1529094 100644
--- a/elf/dl-reloc-static-pie.c
+++ b/elf/dl-reloc-static-pie.c
@@ -19,7 +19,13 @@
 #if ENABLE_STATIC_PIE
 #include <unistd.h>
 #include <ldsodefs.h>
-#include "dynamic-link.h"
+
+#ifndef NESTING
+# define STATIC_PIE_BOOTSTRAP
+# define BOOTSTRAP_MAP (main_map)
+# define RESOLVE_MAP(sym, version, flags) BOOTSTRAP_MAP
+# include "dynamic-link.h"
+#endif /* n NESTING */
 
 /* Relocate static executable with PIE.  */
 
@@ -28,10 +34,12 @@ _dl_relocate_static_pie (void)
 {
   struct link_map *main_map = _dl_get_dl_main_map ();
 
+#ifdef NESTING
 # define STATIC_PIE_BOOTSTRAP
 # define BOOTSTRAP_MAP (main_map)
 # define RESOLVE_MAP(sym, version, flags) BOOTSTRAP_MAP
 # include "dynamic-link.h"
+#endif /* NESTING */
 
   /* Figure out the run-time load address of static PIE.  */
   main_map->l_addr = elf_machine_load_address ();
@@ -46,7 +54,11 @@ _dl_relocate_static_pie (void)
 
   /* Relocate ourselves so we can do normal function calls and
      data access using the global offset table.  */
-  ELF_DYNAMIC_RELOCATE (main_map, 0, 0, 0);
+  ELF_DYNAMIC_RELOCATE (main_map, 0, 0, 0
+#ifndef NESTING
+                        , main_map
+#endif
+                        );
   main_map->l_relocated = 1;
 }
 #endif
diff --git a/sysdeps/x86_64/dl-machine.h b/sysdeps/x86_64/dl-machine.h
index ea9a2366b2..f2b80df619 100644
--- a/sysdeps/x86_64/dl-machine.h
+++ b/sysdeps/x86_64/dl-machine.h
@@ -309,7 +309,7 @@ elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc,
 # ifndef RTLD_BOOTSTRAP
       const ElfW(Sym) *const refsym = sym;
 # endif
-#if !defined NESTING && defined RTLD_BOOTSTRAP
+#if !defined NESTING && (defined RTLD_BOOTSTRAP || defined STATIC_PIE_BOOTSTRAP)
   struct link_map *sym_map = boot_map;
 #else
       struct link_map *sym_map = RESOLVE_MAP (&sym, version, r_type);


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [glibc/maskray/grte] Un-nest an include in dl-reloc-static-pie.c.
@ 2021-08-27 23:49 Fangrui Song
  0 siblings, 0 replies; 3+ messages in thread
From: Fangrui Song @ 2021-08-27 23:49 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=81b46bbe6c41d563d2c23cba37d3d11423e706be

commit 81b46bbe6c41d563d2c23cba37d3d11423e706be
Author: Siva Chandra Reddy <sivachandra@google.com>
Date:   Mon Apr 1 11:26:29 2019 -0700

    Un-nest an include in dl-reloc-static-pie.c.
    
    A corresponding adjustment in sysdeps/x86_64/dl-machine.h has also been
    made.

Diff:
---
 elf/dl-reloc-static-pie.c   | 16 ++++++++++++++--
 sysdeps/x86_64/dl-machine.h |  2 +-
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/elf/dl-reloc-static-pie.c b/elf/dl-reloc-static-pie.c
index bd2d516e5d..42d1529094 100644
--- a/elf/dl-reloc-static-pie.c
+++ b/elf/dl-reloc-static-pie.c
@@ -19,7 +19,13 @@
 #if ENABLE_STATIC_PIE
 #include <unistd.h>
 #include <ldsodefs.h>
-#include "dynamic-link.h"
+
+#ifndef NESTING
+# define STATIC_PIE_BOOTSTRAP
+# define BOOTSTRAP_MAP (main_map)
+# define RESOLVE_MAP(sym, version, flags) BOOTSTRAP_MAP
+# include "dynamic-link.h"
+#endif /* n NESTING */
 
 /* Relocate static executable with PIE.  */
 
@@ -28,10 +34,12 @@ _dl_relocate_static_pie (void)
 {
   struct link_map *main_map = _dl_get_dl_main_map ();
 
+#ifdef NESTING
 # define STATIC_PIE_BOOTSTRAP
 # define BOOTSTRAP_MAP (main_map)
 # define RESOLVE_MAP(sym, version, flags) BOOTSTRAP_MAP
 # include "dynamic-link.h"
+#endif /* NESTING */
 
   /* Figure out the run-time load address of static PIE.  */
   main_map->l_addr = elf_machine_load_address ();
@@ -46,7 +54,11 @@ _dl_relocate_static_pie (void)
 
   /* Relocate ourselves so we can do normal function calls and
      data access using the global offset table.  */
-  ELF_DYNAMIC_RELOCATE (main_map, 0, 0, 0);
+  ELF_DYNAMIC_RELOCATE (main_map, 0, 0, 0
+#ifndef NESTING
+                        , main_map
+#endif
+                        );
   main_map->l_relocated = 1;
 }
 #endif
diff --git a/sysdeps/x86_64/dl-machine.h b/sysdeps/x86_64/dl-machine.h
index ea9a2366b2..f2b80df619 100644
--- a/sysdeps/x86_64/dl-machine.h
+++ b/sysdeps/x86_64/dl-machine.h
@@ -309,7 +309,7 @@ elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc,
 # ifndef RTLD_BOOTSTRAP
       const ElfW(Sym) *const refsym = sym;
 # endif
-#if !defined NESTING && defined RTLD_BOOTSTRAP
+#if !defined NESTING && (defined RTLD_BOOTSTRAP || defined STATIC_PIE_BOOTSTRAP)
   struct link_map *sym_map = boot_map;
 #else
       struct link_map *sym_map = RESOLVE_MAP (&sym, version, r_type);


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-08-28  0:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-28  0:31 [glibc/maskray/grte] Un-nest an include in dl-reloc-static-pie.c Fangrui Song
  -- strict thread matches above, loose matches on Subject: below --
2021-08-28  0:27 Fangrui Song
2021-08-27 23:49 Fangrui Song

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).