public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Nick Clifton <nickc@redhat.com>
To: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>,
	amb <aaronrmb@gmail.com>,
	binutils@sourceware.org
Subject: Re: Linker script and alias to a versioned symbol
Date: Fri, 14 Apr 2023 10:02:10 +0100	[thread overview]
Message-ID: <3ec2f96e-b569-b769-a254-66df7c350fd2@redhat.com> (raw)
In-Reply-To: <0e065789-4adc-b831-9de9-3da5850aa031@oracle.com>

Hi Vladimir,

> Is it possible with compiler/linker options to change the default version of clock_gettime (or GLIBC) in the test below.

Yes/no...

>> In a linker script, is it possible to make sure that a call to
>> clock_gettime ends up invoking clock_gettime@GLIBC_2.2.5 ?
>>
>> I am familiar with how `__asm__(".symver SYM,SYM@GLIBC_VERSION");`
>> works but that's not what I am looking for.

I am intrigued as to why this solution is not sufficient.


>> I would like to know if
>> there is a way to achieve this goal using only a linker script and
>> nothing else.

Sadly the linker script syntax does not provide the functionality you
desire.  About the closet you can get is to use the INCLUDE directive
to load an object file that contains an __asm__ directive like the one
mentioned above.


>> I tried something like this:
>>
>> PROVIDE( clock_gettime = clock_gettime@GLIBC_2.2.5 );
>>
>> But it doesn't seem to work. Maybe the '@' is an invalid char above?

Yes.  The PROVIDE directive only accepts an ordinary symbol name,
not a versioned name.


Cheers
   Nick


      parent reply	other threads:[~2023-04-14  9:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-10 18:35 amb
2023-02-10 19:09 ` Vladimir Mezentsev
2023-04-14  0:57 ` Vladimir Mezentsev
2023-04-14  9:00   ` Frédéric Pétrot
2023-04-14  9:04     ` Nick Clifton
2023-04-14  9:18       ` Frédéric Pétrot
2023-04-14  9:02   ` Nick Clifton [this message]

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=3ec2f96e-b569-b769-a254-66df7c350fd2@redhat.com \
    --to=nickc@redhat.com \
    --cc=aaronrmb@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=vladimir.mezentsev@oracle.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).