unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer via Libc-alpha <libc-alpha@sourceware.org>
To: "Wangbing(wangbing,
	RTOS/Poincare Lab) via Libc-alpha" <libc-alpha@sourceware.org>
Cc: "Wangbing(wangbing,RTOS/Poincare Lab)" <wangbing6@huawei.com>,
	Nixiaoming <nixiaoming@huawei.com>,
	 zhongjubin <zhongjubin@huawei.com>,
	"Yanhuijun (DOPRA SSP)" <yanhuijun@huawei.com>
Subject: Re: Add testcese// [PATCH] dlsym: Add RTLD_PROBE for situation when dlsym only wants to probe a symbol but not use it
Date: Mon, 21 Nov 2022 17:05:06 +0100	[thread overview]
Message-ID: <87r0xwthsd.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <7cad26c73f5b4172bbcf570882bf9d3d@huawei.com> (Wangbing via Libc-alpha's message of "Mon, 21 Nov 2022 14:06:07 +0000")

* Wangbing via Libc-alpha:

> The reason why not useing struct link_map * as an argument to dlsym is
> that there may be more than one same-named symbol in different so
> files(provided by different vendors or components) in one process, and
> by -Wl,-z,now,only the first symbol is needed, and we cannot be sure
> which struct link_map* should be send to dlsym.

You should be able to use the link map of the main program (which is
available through the global _r_debug variable).

Access to _r_debug is currently broken in case of copy relocations, but
I have posted a series that should fix it again.  Then we just need to
document how to access _r_debug, and that the link maps found there can
be used as arguments to dlsym.

For the time being, you can still experiment by building everything with
-fPIC, or an architecture without copy relocations.

Thanks,
Florian


      parent reply	other threads:[~2022-11-21 16:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-21 14:06 Add testcese// [PATCH] dlsym: Add RTLD_PROBE for situation when dlsym only wants to probe a symbol but not use it Wangbing(wangbing, RTOS/Poincare Lab) via Libc-alpha
2022-11-21 14:33 ` Szabolcs Nagy via Libc-alpha
2022-11-21 16:05 ` Florian Weimer via Libc-alpha [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

  List information: https://www.gnu.org/software/libc/involved.html

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

  git send-email \
    --in-reply-to=87r0xwthsd.fsf@oldenburg.str.redhat.com \
    --to=libc-alpha@sourceware.org \
    --cc=fweimer@redhat.com \
    --cc=nixiaoming@huawei.com \
    --cc=wangbing6@huawei.com \
    --cc=yanhuijun@huawei.com \
    --cc=zhongjubin@huawei.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).