public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] x86: Rename readelflib.c and remove EM_IA_64 support
@ 2020-12-04 20:30 H.J. Lu
  2020-12-04 21:05 ` Florian Weimer
  0 siblings, 1 reply; 7+ messages in thread
From: H.J. Lu @ 2020-12-04 20:30 UTC (permalink / raw)
  To: libc-alpha

Rename linux/i386/readelflib.c to linux/x86/readelflib.c and remove
x86_64/readelflib.c.  Also remove EM_IA_64 support from i386 ldconfig.
---
 sysdeps/unix/sysv/linux/{i386 => x86}/readelflib.c | 13 -------------
 sysdeps/unix/sysv/linux/x86_64/readelflib.c        |  2 --
 2 files changed, 15 deletions(-)
 rename sysdeps/unix/sysv/linux/{i386 => x86}/readelflib.c (90%)
 delete mode 100644 sysdeps/unix/sysv/linux/x86_64/readelflib.c

diff --git a/sysdeps/unix/sysv/linux/i386/readelflib.c b/sysdeps/unix/sysv/linux/x86/readelflib.c
similarity index 90%
rename from sysdeps/unix/sysv/linux/i386/readelflib.c
rename to sysdeps/unix/sysv/linux/x86/readelflib.c
index 05f182734a..ccf9361edf 100644
--- a/sysdeps/unix/sysv/linux/i386/readelflib.c
+++ b/sysdeps/unix/sysv/linux/x86/readelflib.c
@@ -44,24 +44,11 @@ process_elf_file (const char *file_name, const char *lib, int *flag,
 	/* X32 libraries are always libc.so.6+.  */
 	file_flag = FLAG_X8664_LIBX32|FLAG_ELF_LIBC6;
       break;
-#ifndef SKIP_EM_IA_64
-    case EM_IA_64:
-      if (elf_header->e_ident[EI_CLASS] == ELFCLASS64)
-	{
-	  /* IA64 64bit libraries are always libc.so.6+.  */
-	  file_flag = FLAG_IA64_LIB64|FLAG_ELF_LIBC6;
-	  break;
-	}
-      goto failed;
-#endif
     case EM_386:
       if (elf_header->e_ident[EI_CLASS] == ELFCLASS32)
 	break;
       /* Fall through.  */
     default:
-#ifndef SKIP_EM_IA_64
-failed:
-#endif
       error (0, 0, _("%s is for unknown machine %d.\n"),
 	     file_name, elf_header->e_machine);
       return 1;
diff --git a/sysdeps/unix/sysv/linux/x86_64/readelflib.c b/sysdeps/unix/sysv/linux/x86_64/readelflib.c
deleted file mode 100644
index 4c4e5f9d1a..0000000000
--- a/sysdeps/unix/sysv/linux/x86_64/readelflib.c
+++ /dev/null
@@ -1,2 +0,0 @@
-#define SKIP_EM_IA_64
-#include <sysdeps/unix/sysv/linux/i386/readelflib.c>
-- 
2.28.0


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

* Re: [PATCH] x86: Rename readelflib.c and remove EM_IA_64 support
  2020-12-04 20:30 [PATCH] x86: Rename readelflib.c and remove EM_IA_64 support H.J. Lu
@ 2020-12-04 21:05 ` Florian Weimer
  2020-12-04 21:13   ` H.J. Lu
  0 siblings, 1 reply; 7+ messages in thread
From: Florian Weimer @ 2020-12-04 21:05 UTC (permalink / raw)
  To: H.J. Lu via Libc-alpha

* H. J. Lu via Libc-alpha:

> Rename linux/i386/readelflib.c to linux/x86/readelflib.c and remove
> x86_64/readelflib.c.  Also remove EM_IA_64 support from i386 ldconfig.

I'm curious—what's the context for this change?

Do the remaining ia64 systems use an ia64 ldconfig?  (The latest CPUs
no longer support i386 IIRC.)

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

* Re: [PATCH] x86: Rename readelflib.c and remove EM_IA_64 support
  2020-12-04 21:05 ` Florian Weimer
@ 2020-12-04 21:13   ` H.J. Lu
  2020-12-04 21:15     ` H.J. Lu
  0 siblings, 1 reply; 7+ messages in thread
From: H.J. Lu @ 2020-12-04 21:13 UTC (permalink / raw)
  To: Florian Weimer; +Cc: H.J. Lu via Libc-alpha

On Fri, Dec 4, 2020 at 1:05 PM Florian Weimer <fw@deneb.enyo.de> wrote:
>
> * H. J. Lu via Libc-alpha:
>
> > Rename linux/i386/readelflib.c to linux/x86/readelflib.c and remove
> > x86_64/readelflib.c.  Also remove EM_IA_64 support from i386 ldconfig.
>
> I'm curious—what's the context for this change?

It is a cleanup job while working on x86-64 ISA level support to ldconfig.

> Do the remaining ia64 systems use an ia64 ldconfig?  (The latest CPUs
> no longer support i386 IIRC.)

There is a separate, unrelated linux/ia64/readelflib.c.

-- 
H.J.

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

* Re: [PATCH] x86: Rename readelflib.c and remove EM_IA_64 support
  2020-12-04 21:13   ` H.J. Lu
@ 2020-12-04 21:15     ` H.J. Lu
  2020-12-05 15:15       ` PATCH] x86: Rename readelflib.c H.J. Lu
  0 siblings, 1 reply; 7+ messages in thread
From: H.J. Lu @ 2020-12-04 21:15 UTC (permalink / raw)
  To: Florian Weimer; +Cc: H.J. Lu via Libc-alpha

On Fri, Dec 4, 2020 at 1:13 PM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> On Fri, Dec 4, 2020 at 1:05 PM Florian Weimer <fw@deneb.enyo.de> wrote:
> >
> > * H. J. Lu via Libc-alpha:
> >
> > > Rename linux/i386/readelflib.c to linux/x86/readelflib.c and remove
> > > x86_64/readelflib.c.  Also remove EM_IA_64 support from i386 ldconfig.
> >
> > I'm curious—what's the context for this change?
>
> It is a cleanup job while working on x86-64 ISA level support to ldconfig.
>
> > Do the remaining ia64 systems use an ia64 ldconfig?  (The latest CPUs
> > no longer support i386 IIRC.)
>
> There is a separate, unrelated linux/ia64/readelflib.c.

With this patch, you can no longer run i386 ldconfig on ia64.   I am not
even sure if it works today.

-- 
H.J.

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

* PATCH] x86: Rename readelflib.c
  2020-12-04 21:15     ` H.J. Lu
@ 2020-12-05 15:15       ` H.J. Lu
  2020-12-06 14:09         ` Florian Weimer
  0 siblings, 1 reply; 7+ messages in thread
From: H.J. Lu @ 2020-12-05 15:15 UTC (permalink / raw)
  To: Florian Weimer; +Cc: H.J. Lu via Libc-alpha

[-- Attachment #1: Type: text/plain, Size: 1006 bytes --]

On Fri, Dec 4, 2020 at 1:15 PM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> On Fri, Dec 4, 2020 at 1:13 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> >
> > On Fri, Dec 4, 2020 at 1:05 PM Florian Weimer <fw@deneb.enyo.de> wrote:
> > >
> > > * H. J. Lu via Libc-alpha:
> > >
> > > > Rename linux/i386/readelflib.c to linux/x86/readelflib.c and remove
> > > > x86_64/readelflib.c.  Also remove EM_IA_64 support from i386 ldconfig.
> > >
> > > I'm curious—what's the context for this change?
> >
> > It is a cleanup job while working on x86-64 ISA level support to ldconfig.
> >
> > > Do the remaining ia64 systems use an ia64 ldconfig?  (The latest CPUs
> > > no longer support i386 IIRC.)
> >
> > There is a separate, unrelated linux/ia64/readelflib.c.
>
> With this patch, you can no longer run i386 ldconfig on ia64.   I am not
> even sure if it works today.
>

Here is the patch just to rename.  I have a followup patch for ldconfig
to add ISA level check to glibc-hwcaps

-- 
H.J.

[-- Attachment #2: 0001-x86-Rename-readelflib.c.patch --]
[-- Type: text/x-patch, Size: 1837 bytes --]

From 505716a17248207709bb325dbbb1723b228b9553 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Fri, 4 Dec 2020 12:24:39 -0800
Subject: [PATCH] x86: Rename readelflib.c

Rename linux/i386/readelflib.c to linux/x86/readelflib.c and remove
x86_64/readelflib.c.
---
 sysdeps/unix/sysv/linux/{i386 => x86}/readelflib.c | 4 ++--
 sysdeps/unix/sysv/linux/x86_64/readelflib.c        | 2 --
 2 files changed, 2 insertions(+), 4 deletions(-)
 rename sysdeps/unix/sysv/linux/{i386 => x86}/readelflib.c (98%)
 delete mode 100644 sysdeps/unix/sysv/linux/x86_64/readelflib.c

diff --git a/sysdeps/unix/sysv/linux/i386/readelflib.c b/sysdeps/unix/sysv/linux/x86/readelflib.c
similarity index 98%
rename from sysdeps/unix/sysv/linux/i386/readelflib.c
rename to sysdeps/unix/sysv/linux/x86/readelflib.c
index 05f182734a..3e83419f5b 100644
--- a/sysdeps/unix/sysv/linux/i386/readelflib.c
+++ b/sysdeps/unix/sysv/linux/x86/readelflib.c
@@ -44,7 +44,7 @@ process_elf_file (const char *file_name, const char *lib, int *flag,
 	/* X32 libraries are always libc.so.6+.  */
 	file_flag = FLAG_X8664_LIBX32|FLAG_ELF_LIBC6;
       break;
-#ifndef SKIP_EM_IA_64
+#ifndef __x86_64__
     case EM_IA_64:
       if (elf_header->e_ident[EI_CLASS] == ELFCLASS64)
 	{
@@ -59,7 +59,7 @@ process_elf_file (const char *file_name, const char *lib, int *flag,
 	break;
       /* Fall through.  */
     default:
-#ifndef SKIP_EM_IA_64
+#ifndef __x86_64__
 failed:
 #endif
       error (0, 0, _("%s is for unknown machine %d.\n"),
diff --git a/sysdeps/unix/sysv/linux/x86_64/readelflib.c b/sysdeps/unix/sysv/linux/x86_64/readelflib.c
deleted file mode 100644
index 4c4e5f9d1a..0000000000
--- a/sysdeps/unix/sysv/linux/x86_64/readelflib.c
+++ /dev/null
@@ -1,2 +0,0 @@
-#define SKIP_EM_IA_64
-#include <sysdeps/unix/sysv/linux/i386/readelflib.c>
-- 
2.28.0


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

* Re: PATCH] x86: Rename readelflib.c
  2020-12-05 15:15       ` PATCH] x86: Rename readelflib.c H.J. Lu
@ 2020-12-06 14:09         ` Florian Weimer
  2020-12-06 14:37           ` H.J. Lu
  0 siblings, 1 reply; 7+ messages in thread
From: Florian Weimer @ 2020-12-06 14:09 UTC (permalink / raw)
  To: H.J. Lu; +Cc: H.J. Lu via Libc-alpha

* H. J. Lu:

> On Fri, Dec 4, 2020 at 1:15 PM H.J. Lu <hjl.tools@gmail.com> wrote:
>>
>> On Fri, Dec 4, 2020 at 1:13 PM H.J. Lu <hjl.tools@gmail.com> wrote:
>> >
>> > On Fri, Dec 4, 2020 at 1:05 PM Florian Weimer <fw@deneb.enyo.de> wrote:
>> > >
>> > > * H. J. Lu via Libc-alpha:
>> > >
>> > > > Rename linux/i386/readelflib.c to linux/x86/readelflib.c and remove
>> > > > x86_64/readelflib.c.  Also remove EM_IA_64 support from i386 ldconfig.
>> > >
>> > > I'm curious—what's the context for this change?
>> >
>> > It is a cleanup job while working on x86-64 ISA level support to ldconfig.
>> >
>> > > Do the remaining ia64 systems use an ia64 ldconfig?  (The latest CPUs
>> > > no longer support i386 IIRC.)
>> >
>> > There is a separate, unrelated linux/ia64/readelflib.c.
>>
>> With this patch, you can no longer run i386 ldconfig on ia64.   I am not
>> even sure if it works today.
>>
>
> Here is the patch just to rename.  I have a followup patch for ldconfig
> to add ISA level check to glibc-hwcaps

I think this is okay.  It would also make sense to process EM_IA_64
unconditionally in support of qemu-user.

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

* Re: PATCH] x86: Rename readelflib.c
  2020-12-06 14:09         ` Florian Weimer
@ 2020-12-06 14:37           ` H.J. Lu
  0 siblings, 0 replies; 7+ messages in thread
From: H.J. Lu @ 2020-12-06 14:37 UTC (permalink / raw)
  To: Florian Weimer; +Cc: H.J. Lu via Libc-alpha

On Sun, Dec 6, 2020 at 6:09 AM Florian Weimer <fw@deneb.enyo.de> wrote:
>
> * H. J. Lu:
>
> > On Fri, Dec 4, 2020 at 1:15 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> >>
> >> On Fri, Dec 4, 2020 at 1:13 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> >> >
> >> > On Fri, Dec 4, 2020 at 1:05 PM Florian Weimer <fw@deneb.enyo.de> wrote:
> >> > >
> >> > > * H. J. Lu via Libc-alpha:
> >> > >
> >> > > > Rename linux/i386/readelflib.c to linux/x86/readelflib.c and remove
> >> > > > x86_64/readelflib.c.  Also remove EM_IA_64 support from i386 ldconfig.
> >> > >
> >> > > I'm curious—what's the context for this change?
> >> >
> >> > It is a cleanup job while working on x86-64 ISA level support to ldconfig.
> >> >
> >> > > Do the remaining ia64 systems use an ia64 ldconfig?  (The latest CPUs
> >> > > no longer support i386 IIRC.)
> >> >
> >> > There is a separate, unrelated linux/ia64/readelflib.c.
> >>
> >> With this patch, you can no longer run i386 ldconfig on ia64.   I am not
> >> even sure if it works today.
> >>
> >
> > Here is the patch just to rename.  I have a followup patch for ldconfig
> > to add ISA level check to glibc-hwcaps
>
> I think this is okay.  It would also make sense to process EM_IA_64
> unconditionally in support of qemu-user.

I am checking my patch as is.

Thanks.

-- 
H.J.

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

end of thread, other threads:[~2020-12-06 14:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-04 20:30 [PATCH] x86: Rename readelflib.c and remove EM_IA_64 support H.J. Lu
2020-12-04 21:05 ` Florian Weimer
2020-12-04 21:13   ` H.J. Lu
2020-12-04 21:15     ` H.J. Lu
2020-12-05 15:15       ` PATCH] x86: Rename readelflib.c H.J. Lu
2020-12-06 14:09         ` Florian Weimer
2020-12-06 14:37           ` H.J. Lu

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).