[1/3] elf: Initialize GLRO (dl_minsigstacksize) after static dlopen

Message ID 8754fc98101550a1354a5dff2447b870a7c04291.1621511874.git.fweimer@redhat.com
State Committed
Headers
Series Convenience function for allocating (alternate signal) stacks |

Checks

Context Check Description
dj/TryBot-apply_patch success Patch applied to master at the time it was sent

Commit Message

Florian Weimer May 20, 2021, 12:13 p.m. UTC
  This is another field of _rtld_global_ro that benefits from
initialization in __rtld_static_init.
---
 elf/rtld_static_init.c | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

H.J. Lu May 20, 2021, 2:40 p.m. UTC | #1
On Thu, May 20, 2021 at 6:08 AM Florian Weimer via Libc-alpha
<libc-alpha@sourceware.org> wrote:
>
> This is another field of _rtld_global_ro that benefits from
> initialization in __rtld_static_init.
> ---
>  elf/rtld_static_init.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/elf/rtld_static_init.c b/elf/rtld_static_init.c
> index bded6bd2d4..9c9e069b4d 100644
> --- a/elf/rtld_static_init.c
> +++ b/elf/rtld_static_init.c
> @@ -49,6 +49,8 @@ __rtld_static_init (struct link_map *map)
>    dl->_dl_hwcap = _dl_hwcap;
>    extern __typeof (dl->_dl_hwcap2) _dl_hwcap2 attribute_hidden;
>    dl->_dl_hwcap2 = _dl_hwcap2;
> +  extern __typeof (dl->_dl_hwcap2) _dl_minsigstacksize attribute_hidden;
> +  dl->_dl_minsigstacksize = _dl_minsigstacksize;
>    extern __typeof (dl->_dl_pagesize) _dl_pagesize attribute_hidden;
>    dl->_dl_pagesize = _dl_pagesize;
>    extern __typeof (dl->_dl_tls_static_align) _dl_tls_static_align
> --
> 2.31.1
>
>

LGTM.

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>

Thanks.
  

Patch

diff --git a/elf/rtld_static_init.c b/elf/rtld_static_init.c
index bded6bd2d4..9c9e069b4d 100644
--- a/elf/rtld_static_init.c
+++ b/elf/rtld_static_init.c
@@ -49,6 +49,8 @@  __rtld_static_init (struct link_map *map)
   dl->_dl_hwcap = _dl_hwcap;
   extern __typeof (dl->_dl_hwcap2) _dl_hwcap2 attribute_hidden;
   dl->_dl_hwcap2 = _dl_hwcap2;
+  extern __typeof (dl->_dl_hwcap2) _dl_minsigstacksize attribute_hidden;
+  dl->_dl_minsigstacksize = _dl_minsigstacksize;
   extern __typeof (dl->_dl_pagesize) _dl_pagesize attribute_hidden;
   dl->_dl_pagesize = _dl_pagesize;
   extern __typeof (dl->_dl_tls_static_align) _dl_tls_static_align