public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v2] elf: Synchronize <elf.h> section header flags with binutils
@ 2020-12-03 13:19 Florian Weimer
  2020-12-03 13:24 ` H.J. Lu
  2020-12-03 13:38 ` Mark Wielaard
  0 siblings, 2 replies; 10+ messages in thread
From: Florian Weimer @ 2020-12-03 13:19 UTC (permalink / raw)
  To: libc-alpha; +Cc: Nick Clifton, Mark J. Wielaard

binutils 2.36 will add SHF_GNU_RETAIN support.  SHF_GNU_BUILD_NOTE
was also missing from the glibc header.

---
v2: Fix typo 29 typo.

 elf/elf.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/elf/elf.h b/elf/elf.h
index 0ed6753a93..bd7af7cca4 100644
--- a/elf/elf.h
+++ b/elf/elf.h
@@ -478,6 +478,8 @@ typedef struct
 #define SHF_COMPRESSED	     (1 << 11)	/* Section with compressed data. */
 #define SHF_MASKOS	     0x0ff00000	/* OS-specific.  */
 #define SHF_MASKPROC	     0xf0000000	/* Processor-specific */
+#define SHF_GNU_BUILD_NOTE   (1 << 20)  /* Contains GNU build notes.  */
+#define SHF_GNU_RETAIN	     (1 << 21)  /* Not to be GCed by linker.  */
 #define SHF_ORDERED	     (1 << 30)	/* Special ordering requirement
 					   (Solaris).  */
 #define SHF_EXCLUDE	     (1U << 31)	/* Section is excluded unless

-- 
Red Hat GmbH, https://de.redhat.com/ , Registered seat: Grasbrunn,
Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Charles Cachera, Brian Klemm, Laurie Krebs, Michael O'Neill


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

* Re: [PATCH v2] elf: Synchronize <elf.h> section header flags with binutils
  2020-12-03 13:19 [PATCH v2] elf: Synchronize <elf.h> section header flags with binutils Florian Weimer
@ 2020-12-03 13:24 ` H.J. Lu
  2020-12-03 13:38 ` Mark Wielaard
  1 sibling, 0 replies; 10+ messages in thread
From: H.J. Lu @ 2020-12-03 13:24 UTC (permalink / raw)
  To: Florian Weimer; +Cc: GNU C Library, Nick Clifton, Mark J. Wielaard

On Thu, Dec 3, 2020 at 5:19 AM Florian Weimer via Libc-alpha
<libc-alpha@sourceware.org> wrote:
>
> binutils 2.36 will add SHF_GNU_RETAIN support.  SHF_GNU_BUILD_NOTE
> was also missing from the glibc header.
>
> ---
> v2: Fix typo 29 typo.
>
>  elf/elf.h | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/elf/elf.h b/elf/elf.h
> index 0ed6753a93..bd7af7cca4 100644
> --- a/elf/elf.h
> +++ b/elf/elf.h
> @@ -478,6 +478,8 @@ typedef struct
>  #define SHF_COMPRESSED      (1 << 11)  /* Section with compressed data. */
>  #define SHF_MASKOS          0x0ff00000 /* OS-specific.  */
>  #define SHF_MASKPROC        0xf0000000 /* Processor-specific */
> +#define SHF_GNU_BUILD_NOTE   (1 << 20)  /* Contains GNU build notes.  */
> +#define SHF_GNU_RETAIN      (1 << 21)  /* Not to be GCed by linker.  */
>  #define SHF_ORDERED         (1 << 30)  /* Special ordering requirement
>                                            (Solaris).  */
>  #define SHF_EXCLUDE         (1U << 31) /* Section is excluded unless
>

LGTM.

Thanks.

-- 
H.J.

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

* Re: [PATCH v2] elf: Synchronize <elf.h> section header flags with binutils
  2020-12-03 13:19 [PATCH v2] elf: Synchronize <elf.h> section header flags with binutils Florian Weimer
  2020-12-03 13:24 ` H.J. Lu
@ 2020-12-03 13:38 ` Mark Wielaard
  2020-12-03 13:45   ` Florian Weimer
  1 sibling, 1 reply; 10+ messages in thread
From: Mark Wielaard @ 2020-12-03 13:38 UTC (permalink / raw)
  To: Florian Weimer, libc-alpha; +Cc: Nick Clifton

Hi Florian,

On Thu, 2020-12-03 at 14:19 +0100, Florian Weimer wrote:
> binutils 2.36 will add SHF_GNU_RETAIN support.  SHF_GNU_BUILD_NOTE
> was also missing from the glibc header.

What is SHF_GNU_BUILD_NOTE? What sets it, when is it set and how should
the presence or absence of the flag be interpreted?

Thanks,

Mark

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

* Re: [PATCH v2] elf: Synchronize <elf.h> section header flags with binutils
  2020-12-03 13:38 ` Mark Wielaard
@ 2020-12-03 13:45   ` Florian Weimer
  2020-12-03 13:59     ` Mark Wielaard
  0 siblings, 1 reply; 10+ messages in thread
From: Florian Weimer @ 2020-12-03 13:45 UTC (permalink / raw)
  To: Mark Wielaard; +Cc: libc-alpha, Nick Clifton

* Mark Wielaard:

> Hi Florian,
>
> On Thu, 2020-12-03 at 14:19 +0100, Florian Weimer wrote:
>> binutils 2.36 will add SHF_GNU_RETAIN support.  SHF_GNU_BUILD_NOTE
>> was also missing from the glibc header.
>
> What is SHF_GNU_BUILD_NOTE? What sets it, when is it set and how should
> the presence or absence of the flag be interpreted?

It was added in:

commit 9ef920e933bf2ea228c909cf81636e6d9577e51e
Author: Nick Clifton <nickc@redhat.com>
Date:   Wed Mar 1 11:09:46 2017 +0000

    Add support for displaying and merging GNU_BUILD_NOTEs.

I agree that it would be nice to add it to the GNU gABI documentation.

In any case, the flag is now taken and should be mentioned in <elf.h>.

Thanks,
Florian
-- 
Red Hat GmbH, https://de.redhat.com/ , Registered seat: Grasbrunn,
Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Charles Cachera, Brian Klemm, Laurie Krebs, Michael O'Neill


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

* Re: [PATCH v2] elf: Synchronize <elf.h> section header flags with binutils
  2020-12-03 13:45   ` Florian Weimer
@ 2020-12-03 13:59     ` Mark Wielaard
  2020-12-07 14:00       ` Nick Clifton
  0 siblings, 1 reply; 10+ messages in thread
From: Mark Wielaard @ 2020-12-03 13:59 UTC (permalink / raw)
  To: Florian Weimer; +Cc: libc-alpha, Nick Clifton

On Thu, 2020-12-03 at 14:45 +0100, Florian Weimer wrote:
> * Mark Wielaard:
> > On Thu, 2020-12-03 at 14:19 +0100, Florian Weimer wrote:
> > > binutils 2.36 will add SHF_GNU_RETAIN support.  SHF_GNU_BUILD_NOTE
> > > was also missing from the glibc header.
> > 
> > What is SHF_GNU_BUILD_NOTE? What sets it, when is it set and how should
> > the presence or absence of the flag be interpreted?
> 
> It was added in:
> 
> commit 9ef920e933bf2ea228c909cf81636e6d9577e51e
> Author: Nick Clifton <nickc@redhat.com>
> Date:   Wed Mar 1 11:09:46 2017 +0000
> 
>     Add support for displaying and merging GNU_BUILD_NOTEs.
> 
> I agree that it would be nice to add it to the GNU gABI documentation.
> 
> In any case, the flag is now taken and should be mentioned in <elf.h>.

But is it really taken or was that just an experiment? A followup
commit (05ed43104e) seems to imply the flag is never actually emitted.

If it is actually taken and used having the precise semantics
documented seems to be essential.

Nick, do you know what is going on here? Both patches are yours.

Cheers,

Mark

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

* Re: [PATCH v2] elf: Synchronize <elf.h> section header flags with binutils
  2020-12-03 13:59     ` Mark Wielaard
@ 2020-12-07 14:00       ` Nick Clifton
  2020-12-07 14:03         ` Florian Weimer
  0 siblings, 1 reply; 10+ messages in thread
From: Nick Clifton @ 2020-12-07 14:00 UTC (permalink / raw)
  To: Mark Wielaard, Florian Weimer; +Cc: libc-alpha

Hi Guys,

> But is it really taken or was that just an experiment? A followup
> commit (05ed43104e) seems to imply the flag is never actually emitted.
> 
> If it is actually taken and used having the precise semantics
> documented seems to be essential.
> 
> Nick, do you know what is going on here? Both patches are yours.

It was an experiment.  And it is no longer needed, although I would
not mind if it stayed around.  But if it makes things simpler then
please do remove it from it from elf.h.

Cheers
   Nick



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

* Re: [PATCH v2] elf: Synchronize <elf.h> section header flags with binutils
  2020-12-07 14:00       ` Nick Clifton
@ 2020-12-07 14:03         ` Florian Weimer
  2020-12-07 16:19           ` Nick Clifton
  0 siblings, 1 reply; 10+ messages in thread
From: Florian Weimer @ 2020-12-07 14:03 UTC (permalink / raw)
  To: Nick Clifton; +Cc: Mark Wielaard, libc-alpha

* Nick Clifton:

> Hi Guys,
>
>> But is it really taken or was that just an experiment? A followup
>> commit (05ed43104e) seems to imply the flag is never actually emitted.
>> If it is actually taken and used having the precise semantics
>> documented seems to be essential.
>> Nick, do you know what is going on here? Both patches are yours.
>
> It was an experiment.  And it is no longer needed, although I would
> not mind if it stayed around.  But if it makes things simpler then
> please do remove it from it from elf.h.

Okay.  Nick, can you remove it from binutils first?

Thanks,
Florian
-- 
Red Hat GmbH, https://de.redhat.com/ , Registered seat: Grasbrunn,
Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Charles Cachera, Brian Klemm, Laurie Krebs, Michael O'Neill


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

* Re: [PATCH v2] elf: Synchronize <elf.h> section header flags with binutils
  2020-12-07 14:03         ` Florian Weimer
@ 2020-12-07 16:19           ` Nick Clifton
  2020-12-11 23:07             ` Mark Wielaard
  0 siblings, 1 reply; 10+ messages in thread
From: Nick Clifton @ 2020-12-07 16:19 UTC (permalink / raw)
  To: Florian Weimer; +Cc: Mark Wielaard, libc-alpha

Hi Florian,

> Okay.  Nick, can you remove it from binutils first?

Done.

Cheers
   Nick



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

* Re: [PATCH v2] elf: Synchronize <elf.h> section header flags with binutils
  2020-12-07 16:19           ` Nick Clifton
@ 2020-12-11 23:07             ` Mark Wielaard
  2020-12-12  9:16               ` Florian Weimer
  0 siblings, 1 reply; 10+ messages in thread
From: Mark Wielaard @ 2020-12-11 23:07 UTC (permalink / raw)
  To: Nick Clifton; +Cc: Florian Weimer, libc-alpha

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

Hi,

On Mon, Dec 07, 2020 at 04:19:50PM +0000, Nick Clifton wrote:
> > Okay.  Nick, can you remove it from binutils first?
> 
> Done.

Thanks, here is a patch to also remove it from glibc elf.h.
OK to push?

Cheers,

Mark

[-- Attachment #2: 0001-elf.h-Remove-SHF_GNU_BUILD_NOTE.patch --]
[-- Type: text/x-diff, Size: 944 bytes --]

From 618e9455fec2d3427ea0e851738b4dfddf914c08 Mon Sep 17 00:00:00 2001
From: Mark Wielaard <mark@klomp.org>
Date: Fri, 11 Dec 2020 23:58:24 +0100
Subject: [PATCH] elf.h: Remove SHF_GNU_BUILD_NOTE.

SHF_GNU_BUILD_NOTE was a binutils experiment.  And it is no longer
needed. It was also removed from binutils.
---
 elf/elf.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/elf/elf.h b/elf/elf.h
index 93994cef2b..eeaa57e34d 100644
--- a/elf/elf.h
+++ b/elf/elf.h
@@ -478,7 +478,6 @@ typedef struct
 #define SHF_COMPRESSED	     (1 << 11)	/* Section with compressed data. */
 #define SHF_MASKOS	     0x0ff00000	/* OS-specific.  */
 #define SHF_MASKPROC	     0xf0000000	/* Processor-specific */
-#define SHF_GNU_BUILD_NOTE   (1 << 20)  /* Contains GNU build notes.  */
 #define SHF_GNU_RETAIN	     (1 << 21)  /* Not to be GCed by linker.  */
 #define SHF_ORDERED	     (1 << 30)	/* Special ordering requirement
 					   (Solaris).  */
-- 
2.20.1


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

* Re: [PATCH v2] elf: Synchronize <elf.h> section header flags with binutils
  2020-12-11 23:07             ` Mark Wielaard
@ 2020-12-12  9:16               ` Florian Weimer
  0 siblings, 0 replies; 10+ messages in thread
From: Florian Weimer @ 2020-12-12  9:16 UTC (permalink / raw)
  To: Mark Wielaard; +Cc: Nick Clifton, Florian Weimer, libc-alpha

* Mark Wielaard:

> On Mon, Dec 07, 2020 at 04:19:50PM +0000, Nick Clifton wrote:
>> > Okay.  Nick, can you remove it from binutils first?
>> 
>> Done.
>
> Thanks, here is a patch to also remove it from glibc elf.h.
> OK to push?

Yes, please.

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

end of thread, other threads:[~2020-12-12  9:16 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-03 13:19 [PATCH v2] elf: Synchronize <elf.h> section header flags with binutils Florian Weimer
2020-12-03 13:24 ` H.J. Lu
2020-12-03 13:38 ` Mark Wielaard
2020-12-03 13:45   ` Florian Weimer
2020-12-03 13:59     ` Mark Wielaard
2020-12-07 14:00       ` Nick Clifton
2020-12-07 14:03         ` Florian Weimer
2020-12-07 16:19           ` Nick Clifton
2020-12-11 23:07             ` Mark Wielaard
2020-12-12  9:16               ` Florian Weimer

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