From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 74AEC3857C47; Mon, 27 Sep 2021 18:54:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 74AEC3857C47 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc/azanella/rtld-shared] elf: Make _dl_map_object_from_fd static X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella X-Git-Refname: refs/heads/azanella/rtld-shared X-Git-Oldrev: 9702f28ab810a8a2e8c7759f10fc8cab1ab8b11e X-Git-Newrev: e53e26dc0c90090406e70fc86c5603d31471c17d Message-Id: <20210927185417.74AEC3857C47@sourceware.org> Date: Mon, 27 Sep 2021 18:54:17 +0000 (GMT) X-BeenThere: glibc-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Sep 2021 18:54:17 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=e53e26dc0c90090406e70fc86c5603d31471c17d commit e53e26dc0c90090406e70fc86c5603d31471c17d Author: Adhemerval Zanella 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 36ad7ca020..4f06c5e510 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 968a58f668..fa1f7be729 100644 --- a/sysdeps/mach/hurd/dl-sysdep.c +++ b/sysdeps/mach/hurd/dl-sysdep.c @@ -116,53 +116,6 @@ _dl_sysdep_start (void **start_argptr, && _dl_hurd_data->user_entry == 0) _dl_hurd_data->user_entry = (vm_address_t) ENTRY_POINT; -#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,