public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Adhemerval Zanella <azanella@sourceware.org>
To: glibc-cvs@sourceware.org
Subject: [glibc/azanella/rtld-shared] elf: Make _dl_map_object_from_fd static
Date: Tue, 10 Aug 2021 13:42:11 +0000 (GMT)	[thread overview]
Message-ID: <20210810134211.3D3FC395C064@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=2ae4f06da6c3ad00807f746128e1f87a541062b9

commit 2ae4f06da6c3ad00807f746128e1f87a541062b9
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Tue Aug 10 09:38:06 2021 -0300

    elf: Make _dl_map_object_from_fd static
    
    And remove ancient Hurd not enabled by default.

Diff:
---
 elf/dl-load.c                 |  5 +----
 sysdeps/mach/hurd/Makefile    |  2 --
 sysdeps/mach/hurd/dl-sysdep.c | 47 -------------------------------------------
 3 files changed, 1 insertion(+), 53 deletions(-)

diff --git a/elf/dl-load.c b/elf/dl-load.c
index fb23ba632b..8533add1b4 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -931,10 +931,7 @@ _dl_process_pt_gnu_property (struct link_map *l, int fd, const ElfW(Phdr) *ph)
 /* Map in the shared object NAME, actually located in REALNAME, and already
    opened on FD.  */
 
-#ifndef EXTERNAL_MAP_FROM_FD
-static
-#endif
-struct link_map *
+static struct link_map *
 _dl_map_object_from_fd (const char *name, const char *origname, int fd,
 			struct filebuf *fbp, char *realname,
 			struct link_map *loader, int l_type, int mode,
diff --git a/sysdeps/mach/hurd/Makefile b/sysdeps/mach/hurd/Makefile
index 17bb643c18..532a890a57 100644
--- a/sysdeps/mach/hurd/Makefile
+++ b/sysdeps/mach/hurd/Makefile
@@ -167,8 +167,6 @@ $(inst_libdir)/libc.so: $(rpcuserlibs)
 # objects directly into the shared object.
 ifeq (elf,$(subdir))
 $(objpfx)librtld.map: $(rpcuserlibs:.so=_pic.a)
-
-CFLAGS-dl-load.c = -DEXTERNAL_MAP_FROM_FD
 endif
 
 # Override the generic Makeconfig values so we link against the RPC libs.
diff --git a/sysdeps/mach/hurd/dl-sysdep.c b/sysdeps/mach/hurd/dl-sysdep.c
index 4b2072e5d5..62e6a5011b 100644
--- a/sysdeps/mach/hurd/dl-sysdep.c
+++ b/sysdeps/mach/hurd/dl-sysdep.c
@@ -149,53 +149,6 @@ _dl_sysdep_start (void **start_argptr,
 
 unfmh();			/* XXX */
 
-#if 0				/* XXX make this work for real someday... */
-      if (_dl_hurd_data->user_entry == (vm_address_t) ENTRY_POINT)
-	/* We were invoked as a command, not as the program interpreter.
-	   The generic ld.so code supports this: it will parse the args
-	   as "ld.so PROGRAM [ARGS...]".  For booting the Hurd, we
-	   support an additional special syntax:
-	     ld.so [-LIBS...] PROGRAM [ARGS...]
-	   Each LIBS word consists of "FILENAME=MEMOBJ";
-	   for example "-/lib/libc.so=123" says that the contents of
-	   /lib/libc.so are found in a memory object whose port name
-	   in our task is 123.  */
-	while (_dl_argc > 2 && _dl_argv[1][0] == '-' && _dl_argv[1][1] != '-')
-	  {
-	    char *lastslash, *memobjname, *p;
-	    struct link_map *l;
-	    mach_port_t memobj;
-	    error_t err;
-
-	    ++_dl_skip_args;
-	    --_dl_argc;
-	    p = _dl_argv++[1] + 1;
-
-	    memobjname = strchr (p, '=');
-	    if (! memobjname)
-	      _dl_sysdep_fatal ("Bogus library spec: ", p, "\n", NULL);
-	    *memobjname++ = '\0';
-	    memobj = 0;
-	    while (*memobjname != '\0')
-	      memobj = (memobj * 10) + (*memobjname++ - '0');
-
-	    /* Add a user reference on the memory object port, so we will
-	       still have one after _dl_map_object_from_fd calls our
-	       `close'.  */
-	    err = __mach_port_mod_refs (__mach_task_self (), memobj,
-					MACH_PORT_RIGHT_SEND, +1);
-	    assert_perror (err);
-
-	    lastslash = strrchr (p, '/');
-	    l = _dl_map_object_from_fd (lastslash ? lastslash + 1 : p, NULL,
-					memobj, strdup (p), 0);
-
-	    /* Squirrel away the memory object port where it
-	       can be retrieved by the program later.  */
-	    l->l_info[DT_NULL] = (void *) memobj;
-	  }
-#endif
-
       /* Call elf/rtld.c's main program.  It will set everything
 	 up and leave us to transfer control to USER_ENTRY.  */
       (*dl_main) ((const ElfW(Phdr) *) _dl_hurd_data->phdr,


             reply	other threads:[~2021-08-10 13:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-10 13:42 Adhemerval Zanella [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-09-27 18:54 Adhemerval Zanella
2021-08-10 12:43 Adhemerval Zanella

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210810134211.3D3FC395C064@sourceware.org \
    --to=azanella@sourceware.org \
    --cc=glibc-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).