* [PATCH] elf: Delete obsoleted DISTINGUISH_LIB_VERSIONS
@ 2021-08-07 5:12 Fangrui Song via Libc-alpha
2021-08-16 17:03 ` Fāng-ruì Sòng via Libc-alpha
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Fangrui Song via Libc-alpha @ 2021-08-07 5:12 UTC (permalink / raw)
To: libc-alpha
and its only definition in i386/dl-librecon.h which essentially
hasn't been updated since 2004.
---
elf/rtld.c | 4 ----
sysdeps/unix/sysv/linux/i386/dl-librecon.h | 25 ----------------------
2 files changed, 29 deletions(-)
diff --git a/elf/rtld.c b/elf/rtld.c
index d733359eaf..4196bae703 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -1637,10 +1637,6 @@ dl_main (const ElfW(Phdr) *phdr,
if (main_map->l_ld == NULL)
_exit (1);
- /* We allow here some platform specific code. */
-#ifdef DISTINGUISH_LIB_VERSIONS
- DISTINGUISH_LIB_VERSIONS;
-#endif
_exit (has_interp ? 0 : 2);
}
diff --git a/sysdeps/unix/sysv/linux/i386/dl-librecon.h b/sysdeps/unix/sysv/linux/i386/dl-librecon.h
index 7efe0679b3..e4d90529b8 100644
--- a/sysdeps/unix/sysv/linux/i386/dl-librecon.h
+++ b/sysdeps/unix/sysv/linux/i386/dl-librecon.h
@@ -21,31 +21,6 @@
#include <sysdeps/unix/sysv/linux/dl-librecon.h>
-#define DISTINGUISH_LIB_VERSIONS \
- do \
- { \
- /* We have to find out whether the binary is linked against \
- libc 5 or glibc. We do this by looking at all the DT_NEEDED \
- entries. If one is libc.so.5 this is a libc 5 linked binary. */ \
- if (main_map->l_info[DT_NEEDED]) \
- { \
- /* We have dependencies. */ \
- const ElfW(Dyn) *d; \
- const char *strtab; \
- \
- strtab = (const char *) D_PTR (main_map, l_info[DT_STRTAB]); \
- \
- for (d = main_map->l_ld; d->d_tag != DT_NULL; ++d) \
- if (d->d_tag == DT_NEEDED \
- && strcmp (strtab + d->d_un.d_val, "libc.so.5") == 0) \
- break; \
- \
- /* We print a `5' or `6' depending on the outcome. */ \
- _dl_printf (d->d_tag != DT_NULL ? "5\n" : "6\n"); \
- } \
- } \
- while (0)
-
/* Recognizing extra environment variables. */
#define EXTRA_LD_ENVVARS \
case 15: \
--
2.32.0.605.g8dce9f2422-goog
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] elf: Delete obsoleted DISTINGUISH_LIB_VERSIONS
2021-08-07 5:12 [PATCH] elf: Delete obsoleted DISTINGUISH_LIB_VERSIONS Fangrui Song via Libc-alpha
@ 2021-08-16 17:03 ` Fāng-ruì Sòng via Libc-alpha
2021-08-16 17:13 ` Florian Weimer via Libc-alpha
2021-08-17 7:51 ` Andreas Schwab
2 siblings, 0 replies; 5+ messages in thread
From: Fāng-ruì Sòng via Libc-alpha @ 2021-08-16 17:03 UTC (permalink / raw)
To: libc-alpha
Ping
On Fri, Aug 6, 2021 at 10:12 PM Fangrui Song <maskray@google.com> wrote:
>
> and its only definition in i386/dl-librecon.h which essentially
> hasn't been updated since 2004.
> ---
> elf/rtld.c | 4 ----
> sysdeps/unix/sysv/linux/i386/dl-librecon.h | 25 ----------------------
> 2 files changed, 29 deletions(-)
>
> diff --git a/elf/rtld.c b/elf/rtld.c
> index d733359eaf..4196bae703 100644
> --- a/elf/rtld.c
> +++ b/elf/rtld.c
> @@ -1637,10 +1637,6 @@ dl_main (const ElfW(Phdr) *phdr,
> if (main_map->l_ld == NULL)
> _exit (1);
>
> - /* We allow here some platform specific code. */
> -#ifdef DISTINGUISH_LIB_VERSIONS
> - DISTINGUISH_LIB_VERSIONS;
> -#endif
> _exit (has_interp ? 0 : 2);
> }
>
> diff --git a/sysdeps/unix/sysv/linux/i386/dl-librecon.h b/sysdeps/unix/sysv/linux/i386/dl-librecon.h
> index 7efe0679b3..e4d90529b8 100644
> --- a/sysdeps/unix/sysv/linux/i386/dl-librecon.h
> +++ b/sysdeps/unix/sysv/linux/i386/dl-librecon.h
> @@ -21,31 +21,6 @@
>
> #include <sysdeps/unix/sysv/linux/dl-librecon.h>
>
> -#define DISTINGUISH_LIB_VERSIONS \
> - do \
> - { \
> - /* We have to find out whether the binary is linked against \
> - libc 5 or glibc. We do this by looking at all the DT_NEEDED \
> - entries. If one is libc.so.5 this is a libc 5 linked binary. */ \
> - if (main_map->l_info[DT_NEEDED]) \
> - { \
> - /* We have dependencies. */ \
> - const ElfW(Dyn) *d; \
> - const char *strtab; \
> - \
> - strtab = (const char *) D_PTR (main_map, l_info[DT_STRTAB]); \
> - \
> - for (d = main_map->l_ld; d->d_tag != DT_NULL; ++d) \
> - if (d->d_tag == DT_NEEDED \
> - && strcmp (strtab + d->d_un.d_val, "libc.so.5") == 0) \
> - break; \
> - \
> - /* We print a `5' or `6' depending on the outcome. */ \
> - _dl_printf (d->d_tag != DT_NULL ? "5\n" : "6\n"); \
> - } \
> - } \
> - while (0)
> -
> /* Recognizing extra environment variables. */
> #define EXTRA_LD_ENVVARS \
> case 15: \
> --
> 2.32.0.605.g8dce9f2422-goog
>
--
宋方睿
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] elf: Delete obsoleted DISTINGUISH_LIB_VERSIONS
2021-08-07 5:12 [PATCH] elf: Delete obsoleted DISTINGUISH_LIB_VERSIONS Fangrui Song via Libc-alpha
2021-08-16 17:03 ` Fāng-ruì Sòng via Libc-alpha
@ 2021-08-16 17:13 ` Florian Weimer via Libc-alpha
2021-08-16 17:36 ` Fāng-ruì Sòng via Libc-alpha
2021-08-17 7:51 ` Andreas Schwab
2 siblings, 1 reply; 5+ messages in thread
From: Florian Weimer via Libc-alpha @ 2021-08-16 17:13 UTC (permalink / raw)
To: Fangrui Song via Libc-alpha
* Fangrui Song via Libc-alpha:
> and its only definition in i386/dl-librecon.h which essentially
> hasn't been updated since 2004.
There is closely related to this around _DL_CACHE_DEFAULT_ID and
FLAG_ELF_LIBC5. Should that be removed as well?
Thanks,
Florian
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] elf: Delete obsoleted DISTINGUISH_LIB_VERSIONS
2021-08-16 17:13 ` Florian Weimer via Libc-alpha
@ 2021-08-16 17:36 ` Fāng-ruì Sòng via Libc-alpha
0 siblings, 0 replies; 5+ messages in thread
From: Fāng-ruì Sòng via Libc-alpha @ 2021-08-16 17:36 UTC (permalink / raw)
To: Florian Weimer; +Cc: Fangrui Song via Libc-alpha
On Mon, Aug 16, 2021 at 10:13 AM Florian Weimer <fweimer@redhat.com> wrote:
>
> * Fangrui Song via Libc-alpha:
>
> > and its only definition in i386/dl-librecon.h which essentially
> > hasn't been updated since 2004.
>
> There is closely related to this around _DL_CACHE_DEFAULT_ID and
> FLAG_ELF_LIBC5. Should that be removed as well?
>
> Thanks,
> Florian
I can take a look. _DL_CACHE_DEFAULT_ID and FLAG_ELF_LIBC5 appear to
be used by more arches.
I think it may be prudent to treat them separately.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] elf: Delete obsoleted DISTINGUISH_LIB_VERSIONS
2021-08-07 5:12 [PATCH] elf: Delete obsoleted DISTINGUISH_LIB_VERSIONS Fangrui Song via Libc-alpha
2021-08-16 17:03 ` Fāng-ruì Sòng via Libc-alpha
2021-08-16 17:13 ` Florian Weimer via Libc-alpha
@ 2021-08-17 7:51 ` Andreas Schwab
2 siblings, 0 replies; 5+ messages in thread
From: Andreas Schwab @ 2021-08-17 7:51 UTC (permalink / raw)
To: Fangrui Song via Libc-alpha
On Aug 06 2021, Fangrui Song via Libc-alpha wrote:
> and its only definition in i386/dl-librecon.h which essentially
> hasn't been updated since 2004.
What has obsoleted it? Why is it relevant how long a block of code has
been stable?
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
"And now for something completely different."
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-08-17 7:53 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-07 5:12 [PATCH] elf: Delete obsoleted DISTINGUISH_LIB_VERSIONS Fangrui Song via Libc-alpha
2021-08-16 17:03 ` Fāng-ruì Sòng via Libc-alpha
2021-08-16 17:13 ` Florian Weimer via Libc-alpha
2021-08-16 17:36 ` Fāng-ruì Sòng via Libc-alpha
2021-08-17 7:51 ` Andreas Schwab
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).