public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Michael Jeanson <mjeanson@efficios.com>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: libc-alpha@sourceware.org,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Subject: Re: [PATCH] nptl: fix potential merge of __rseq_* relro symbols
Date: Mon, 15 Jan 2024 16:44:56 -0500	[thread overview]
Message-ID: <bb30fbbd-a807-4036-bbc7-ec6f69d46dfd@efficios.com> (raw)
In-Reply-To: <308d8dd5-551c-403f-a634-23990be2db64@efficios.com>

On 2024-01-15 16:34, Michael Jeanson wrote:
> On 2024-01-15 16:20, H.J. Lu wrote:
>>> +/* Due to the use of '-fmerge-all-constants' the compiler is allowed to merge
>>> +   all 'const' variables of the same size that are initialized to the same
>>> +   value.  To work around this, declare them as regular static variable 
>>> and use
>>> +   an alias that is 'const'.  */
>>> +static unsigned int rseq_size attribute_relro;
>>> +extern const unsigned int __attribute__ ((alias ("rseq_size"))) __rseq_size;
>>> +static ptrdiff_t rseq_offset attribute_relro;
>>> +extern const ptrdiff_t __attribute__ ((alias ("rseq_offset"))) __rseq_offset;
>>
>> Don't you want to mark them as hidden if they are internal to glibc?
> 
> Indeed, the static variables should be hidden, I thought the build system was 
> setup to make them by default, I'll send a v2.

I answered this one too quickly, the 'static' symbols rseq_size and 
rseq_offset are hidden which is okay and the alias symbols __rseq_size and 
__rseq_offset are public and part of the API/ABI since 2.35.

Michael


  reply	other threads:[~2024-01-15 21:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-15 21:09 Michael Jeanson
2024-01-15 21:20 ` H.J. Lu
2024-01-15 21:34   ` Michael Jeanson
2024-01-15 21:44     ` Michael Jeanson [this message]
2024-01-16 11:25 ` Florian Weimer
2024-01-16 15:28   ` Michael Jeanson
2024-01-22 22:11   ` [PATCH v2] " Michael Jeanson
2024-01-22 22:13     ` Michael Jeanson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bb30fbbd-a807-4036-bbc7-ec6f69d46dfd@efficios.com \
    --to=mjeanson@efficios.com \
    --cc=hjl.tools@gmail.com \
    --cc=libc-alpha@sourceware.org \
    --cc=mathieu.desnoyers@efficios.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).