public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Support AT_BSDFLAGS on FreeBSD.
@ 2020-03-25 17:25 John Baldwin
  2020-03-25 19:00 ` Simon Marchi
  0 siblings, 1 reply; 7+ messages in thread
From: John Baldwin @ 2020-03-25 17:25 UTC (permalink / raw)
  To: gdb-patches, binutils

include/ChangeLog:

	* elf/common.h (AT_FREEBSD_BSDFLAGS): Define.

gdb/ChangeLog:

	* fbsd-tdep.c (fbsd_print_auxv_entry): Handle AT_FREEBSD_BSDFLAGS.
---
 gdb/ChangeLog        | 4 ++++
 gdb/fbsd-tdep.c      | 1 +
 include/ChangeLog    | 4 ++++
 include/elf/common.h | 1 +
 4 files changed, 10 insertions(+)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 5400a4e348..782e955358 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@
+2020-03-25  John Baldwin  <jhb@FreeBSD.org>
+
+	* fbsd-tdep.c (fbsd_print_auxv_entry): Handle AT_FREEBSD_BSDFLAGS.
+
 2020-03-25  Hannes Domani  <ssbssa@yahoo.de>
 
 	* windows-nat.c (windows_add_all_dlls): Fix system dll paths.
diff --git a/gdb/fbsd-tdep.c b/gdb/fbsd-tdep.c
index ffffb18700..54f5149e5c 100644
--- a/gdb/fbsd-tdep.c
+++ b/gdb/fbsd-tdep.c
@@ -1597,6 +1597,7 @@ fbsd_print_auxv_entry (struct gdbarch *gdbarch, struct ui_file *file,
       TAG (EHDRFLAGS, _("ELF header e_flags"), AUXV_FORMAT_HEX);
       TAG (HWCAP, _("Machine-dependent CPU capability hints"), AUXV_FORMAT_HEX);
       TAG (HWCAP2, _("Extension of AT_HWCAP"), AUXV_FORMAT_HEX);
+      TAG (BSDFLAGS, _("ELF BSD flags"), AUXV_FORMAT_HEX);
     }
 
   fprint_auxv_entry (file, name, description, format, type, val);
diff --git a/include/ChangeLog b/include/ChangeLog
index 3d26a570ca..3f3e3caa0f 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,7 @@
+2020-03-25  John Baldwin  <jhb@FreeBSD.org>
+
+	* elf/common.h (AT_FREEBSD_BSDFLAGS): Define.
+
 2020-03-24  Martin Liska  <mliska@suse.cz>
 
 	PR lto/94249
diff --git a/include/elf/common.h b/include/elf/common.h
index 1c84ccb430..6741c34a00 100644
--- a/include/elf/common.h
+++ b/include/elf/common.h
@@ -1251,6 +1251,7 @@
 #define AT_FREEBSD_EHDRFLAGS    24      /* e_flags field from ELF header. */
 #define AT_FREEBSD_HWCAP        25      /* CPU feature flags. */
 #define AT_FREEBSD_HWCAP2       26      /* CPU feature flags 2. */
+#define AT_FREEBSD_BSDFLAGS     27      /* ELF BSD Flags. */
 
 #define AT_SUN_UID      2000    /* Effective user ID.  */
 #define AT_SUN_RUID     2001    /* Real user ID.  */
-- 
2.25.1


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

* Re: [PATCH] Support AT_BSDFLAGS on FreeBSD.
  2020-03-25 17:25 [PATCH] Support AT_BSDFLAGS on FreeBSD John Baldwin
@ 2020-03-25 19:00 ` Simon Marchi
  2020-03-25 20:37   ` John Baldwin
  0 siblings, 1 reply; 7+ messages in thread
From: Simon Marchi @ 2020-03-25 19:00 UTC (permalink / raw)
  To: John Baldwin, gdb-patches, binutils

Hi John,

Could you please add a commit message that summarizes what this is (you can link
to existing documentation) and what is the intent of this change?  Are there some
user-visible changes, what are they?

Thanks,

Simon

On 2020-03-25 1:25 p.m., John Baldwin wrote:
> include/ChangeLog:
> 
> 	* elf/common.h (AT_FREEBSD_BSDFLAGS): Define.
> 
> gdb/ChangeLog:
> 
> 	* fbsd-tdep.c (fbsd_print_auxv_entry): Handle AT_FREEBSD_BSDFLAGS.
> ---
>  gdb/ChangeLog        | 4 ++++
>  gdb/fbsd-tdep.c      | 1 +
>  include/ChangeLog    | 4 ++++
>  include/elf/common.h | 1 +
>  4 files changed, 10 insertions(+)
> 
> diff --git a/gdb/ChangeLog b/gdb/ChangeLog
> index 5400a4e348..782e955358 100644
> --- a/gdb/ChangeLog
> +++ b/gdb/ChangeLog
> @@ -1,3 +1,7 @@
> +2020-03-25  John Baldwin  <jhb@FreeBSD.org>
> +
> +	* fbsd-tdep.c (fbsd_print_auxv_entry): Handle AT_FREEBSD_BSDFLAGS.
> +
>  2020-03-25  Hannes Domani  <ssbssa@yahoo.de>
>  
>  	* windows-nat.c (windows_add_all_dlls): Fix system dll paths.
> diff --git a/gdb/fbsd-tdep.c b/gdb/fbsd-tdep.c
> index ffffb18700..54f5149e5c 100644
> --- a/gdb/fbsd-tdep.c
> +++ b/gdb/fbsd-tdep.c
> @@ -1597,6 +1597,7 @@ fbsd_print_auxv_entry (struct gdbarch *gdbarch, struct ui_file *file,
>        TAG (EHDRFLAGS, _("ELF header e_flags"), AUXV_FORMAT_HEX);
>        TAG (HWCAP, _("Machine-dependent CPU capability hints"), AUXV_FORMAT_HEX);
>        TAG (HWCAP2, _("Extension of AT_HWCAP"), AUXV_FORMAT_HEX);
> +      TAG (BSDFLAGS, _("ELF BSD flags"), AUXV_FORMAT_HEX);
>      }
>  
>    fprint_auxv_entry (file, name, description, format, type, val);
> diff --git a/include/ChangeLog b/include/ChangeLog
> index 3d26a570ca..3f3e3caa0f 100644
> --- a/include/ChangeLog
> +++ b/include/ChangeLog
> @@ -1,3 +1,7 @@
> +2020-03-25  John Baldwin  <jhb@FreeBSD.org>
> +
> +	* elf/common.h (AT_FREEBSD_BSDFLAGS): Define.
> +
>  2020-03-24  Martin Liska  <mliska@suse.cz>
>  
>  	PR lto/94249
> diff --git a/include/elf/common.h b/include/elf/common.h
> index 1c84ccb430..6741c34a00 100644
> --- a/include/elf/common.h
> +++ b/include/elf/common.h
> @@ -1251,6 +1251,7 @@
>  #define AT_FREEBSD_EHDRFLAGS    24      /* e_flags field from ELF header. */
>  #define AT_FREEBSD_HWCAP        25      /* CPU feature flags. */
>  #define AT_FREEBSD_HWCAP2       26      /* CPU feature flags 2. */
> +#define AT_FREEBSD_BSDFLAGS     27      /* ELF BSD Flags. */
>  
>  #define AT_SUN_UID      2000    /* Effective user ID.  */
>  #define AT_SUN_RUID     2001    /* Real user ID.  */
> -- 
> 2.25.1
> 


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

* Re: [PATCH] Support AT_BSDFLAGS on FreeBSD.
  2020-03-25 19:00 ` Simon Marchi
@ 2020-03-25 20:37   ` John Baldwin
  2020-03-25 21:04     ` Simon Marchi
  0 siblings, 1 reply; 7+ messages in thread
From: John Baldwin @ 2020-03-25 20:37 UTC (permalink / raw)
  To: Simon Marchi, gdb-patches, binutils

On 3/25/20 12:00 PM, Simon Marchi wrote:
> Hi John,
> 
> Could you please add a commit message that summarizes what this is (you can link
> to existing documentation) and what is the intent of this change?  Are there some
> user-visible changes, what are they?

I can add something.  To date there aren't any user-visible changes.  There is
one flag defined that indicates that the running FreeBSD kernel supports a new
'sigfastblock' system call that allows a thread to register a signal mask in user
memory that is treated as the signal mask so that sigprocmask() can just modify
that mask in userland without invoking actual system calls.  It's not documented
though aside from the upstream commit message.

> Thanks,
> 
> Simon
> 
> On 2020-03-25 1:25 p.m., John Baldwin wrote:
>> include/ChangeLog:
>>
>> 	* elf/common.h (AT_FREEBSD_BSDFLAGS): Define.
>>
>> gdb/ChangeLog:
>>
>> 	* fbsd-tdep.c (fbsd_print_auxv_entry): Handle AT_FREEBSD_BSDFLAGS.
>> ---
>>  gdb/ChangeLog        | 4 ++++
>>  gdb/fbsd-tdep.c      | 1 +
>>  include/ChangeLog    | 4 ++++
>>  include/elf/common.h | 1 +
>>  4 files changed, 10 insertions(+)
>>
>> diff --git a/gdb/ChangeLog b/gdb/ChangeLog
>> index 5400a4e348..782e955358 100644
>> --- a/gdb/ChangeLog
>> +++ b/gdb/ChangeLog
>> @@ -1,3 +1,7 @@
>> +2020-03-25  John Baldwin  <jhb@FreeBSD.org>
>> +
>> +	* fbsd-tdep.c (fbsd_print_auxv_entry): Handle AT_FREEBSD_BSDFLAGS.
>> +
>>  2020-03-25  Hannes Domani  <ssbssa@yahoo.de>
>>  
>>  	* windows-nat.c (windows_add_all_dlls): Fix system dll paths.
>> diff --git a/gdb/fbsd-tdep.c b/gdb/fbsd-tdep.c
>> index ffffb18700..54f5149e5c 100644
>> --- a/gdb/fbsd-tdep.c
>> +++ b/gdb/fbsd-tdep.c
>> @@ -1597,6 +1597,7 @@ fbsd_print_auxv_entry (struct gdbarch *gdbarch, struct ui_file *file,
>>        TAG (EHDRFLAGS, _("ELF header e_flags"), AUXV_FORMAT_HEX);
>>        TAG (HWCAP, _("Machine-dependent CPU capability hints"), AUXV_FORMAT_HEX);
>>        TAG (HWCAP2, _("Extension of AT_HWCAP"), AUXV_FORMAT_HEX);
>> +      TAG (BSDFLAGS, _("ELF BSD flags"), AUXV_FORMAT_HEX);
>>      }
>>  
>>    fprint_auxv_entry (file, name, description, format, type, val);
>> diff --git a/include/ChangeLog b/include/ChangeLog
>> index 3d26a570ca..3f3e3caa0f 100644
>> --- a/include/ChangeLog
>> +++ b/include/ChangeLog
>> @@ -1,3 +1,7 @@
>> +2020-03-25  John Baldwin  <jhb@FreeBSD.org>
>> +
>> +	* elf/common.h (AT_FREEBSD_BSDFLAGS): Define.
>> +
>>  2020-03-24  Martin Liska  <mliska@suse.cz>
>>  
>>  	PR lto/94249
>> diff --git a/include/elf/common.h b/include/elf/common.h
>> index 1c84ccb430..6741c34a00 100644
>> --- a/include/elf/common.h
>> +++ b/include/elf/common.h
>> @@ -1251,6 +1251,7 @@
>>  #define AT_FREEBSD_EHDRFLAGS    24      /* e_flags field from ELF header. */
>>  #define AT_FREEBSD_HWCAP        25      /* CPU feature flags. */
>>  #define AT_FREEBSD_HWCAP2       26      /* CPU feature flags 2. */
>> +#define AT_FREEBSD_BSDFLAGS     27      /* ELF BSD Flags. */
>>  
>>  #define AT_SUN_UID      2000    /* Effective user ID.  */
>>  #define AT_SUN_RUID     2001    /* Real user ID.  */
>> -- 
>> 2.25.1
>>
> 


-- 
John Baldwin

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

* Re: [PATCH] Support AT_BSDFLAGS on FreeBSD.
  2020-03-25 20:37   ` John Baldwin
@ 2020-03-25 21:04     ` Simon Marchi
  2020-03-25 22:05       ` John Baldwin
  0 siblings, 1 reply; 7+ messages in thread
From: Simon Marchi @ 2020-03-25 21:04 UTC (permalink / raw)
  To: John Baldwin, gdb-patches, binutils

On 2020-03-25 4:37 p.m., John Baldwin wrote:
> I can add something.  To date there aren't any user-visible changes.  There is
> one flag defined that indicates that the running FreeBSD kernel supports a new
> 'sigfastblock' system call that allows a thread to register a signal mask in user
> memory that is treated as the signal mask so that sigprocmask() can just modify
> that mask in userland without invoking actual system calls.  It's not documented
> though aside from the upstream commit message.
The commit changes fbsd_print_auxv_entry, so I presume that GDB will start printing
this auxv entry, if it is present, won't it?  Isn't that a user-visible change?

Even if there is no user-visible change, it's good to mention it, as well as why you'd
like to make the change.  The reviewer and future reader of this commit are not in your
head and don't have the same context to know why this was added.

Simon

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

* Re: [PATCH] Support AT_BSDFLAGS on FreeBSD.
  2020-03-25 21:04     ` Simon Marchi
@ 2020-03-25 22:05       ` John Baldwin
  2020-03-25 22:11         ` John Baldwin
  0 siblings, 1 reply; 7+ messages in thread
From: John Baldwin @ 2020-03-25 22:05 UTC (permalink / raw)
  To: Simon Marchi, gdb-patches, binutils

On 3/25/20 2:04 PM, Simon Marchi wrote:
> On 2020-03-25 4:37 p.m., John Baldwin wrote:
>> I can add something.  To date there aren't any user-visible changes.  There is
>> one flag defined that indicates that the running FreeBSD kernel supports a new
>> 'sigfastblock' system call that allows a thread to register a signal mask in user
>> memory that is treated as the signal mask so that sigprocmask() can just modify
>> that mask in userland without invoking actual system calls.  It's not documented
>> though aside from the upstream commit message.
> The commit changes fbsd_print_auxv_entry, so I presume that GDB will start printing
> this auxv entry, if it is present, won't it?  Isn't that a user-visible change?

Ah, yes.

> Even if there is no user-visible change, it's good to mention it, as well as why you'd
> like to make the change.  The reviewer and future reader of this commit are not in your
> head and don't have the same context to know why this was added.

Fair enough (and I often make similar points in other contexts).
Note that in this case I reused the same commit log from the last
new auxv entry I added (albeit back in 2018).

-- 
John Baldwin

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

* Re: [PATCH] Support AT_BSDFLAGS on FreeBSD.
  2020-03-25 22:05       ` John Baldwin
@ 2020-03-25 22:11         ` John Baldwin
  2020-03-26 12:49           ` Simon Marchi
  0 siblings, 1 reply; 7+ messages in thread
From: John Baldwin @ 2020-03-25 22:11 UTC (permalink / raw)
  To: Simon Marchi, gdb-patches, binutils

How about this updated log:

    Support AT_BSDFLAGS on FreeBSD.
    
    FreeBSD's kernel recently added a new ELF auxiliary vector entry
    holding a mask of software features provided by the kernel.  This
    change fixes 'info auxv' to report the name and description for this
    vector entry instead of '???'.
    
    include/ChangeLog:
    
            * elf/common.h (AT_FREEBSD_BSDFLAGS): Define.
    
    gdb/ChangeLog:
    
            * fbsd-tdep.c (fbsd_print_auxv_entry): Handle AT_FREEBSD_BSDFLAGS.


-- 
John Baldwin

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

* Re: [PATCH] Support AT_BSDFLAGS on FreeBSD.
  2020-03-25 22:11         ` John Baldwin
@ 2020-03-26 12:49           ` Simon Marchi
  0 siblings, 0 replies; 7+ messages in thread
From: Simon Marchi @ 2020-03-26 12:49 UTC (permalink / raw)
  To: John Baldwin, gdb-patches, binutils

On 2020-03-25 6:11 p.m., John Baldwin wrote:
> How about this updated log:
> 
>     Support AT_BSDFLAGS on FreeBSD.
>     
>     FreeBSD's kernel recently added a new ELF auxiliary vector entry
>     holding a mask of software features provided by the kernel.  This
>     change fixes 'info auxv' to report the name and description for this
>     vector entry instead of '???'.
>     
>     include/ChangeLog:
>     
>             * elf/common.h (AT_FREEBSD_BSDFLAGS): Define.
>     
>     gdb/ChangeLog:
>     
>             * fbsd-tdep.c (fbsd_print_auxv_entry): Handle AT_FREEBSD_BSDFLAGS.
> 
> 
> -- 
> John Baldwin
> 

Thanks, this LGTM.

Simon

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

end of thread, other threads:[~2020-03-26 12:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-25 17:25 [PATCH] Support AT_BSDFLAGS on FreeBSD John Baldwin
2020-03-25 19:00 ` Simon Marchi
2020-03-25 20:37   ` John Baldwin
2020-03-25 21:04     ` Simon Marchi
2020-03-25 22:05       ` John Baldwin
2020-03-25 22:11         ` John Baldwin
2020-03-26 12:49           ` Simon Marchi

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