From: PODOPLELOV Andrei <Andrei.PODOPLELOV@3ds.com>
To: Florian Weimer <fweimer@redhat.com>
Cc: "mtk.manpages@gmail.com" <mtk.manpages@gmail.com>,
"linux-man@vger.kernel.org" <linux-man@vger.kernel.org>,
"alx.manpages@gmail.com" <alx.manpages@gmail.com>
Subject: RE: [patch] --filter option in ld: srcfix
Date: Thu, 9 Dec 2021 01:08:12 +0000 [thread overview]
Message-ID: <11c8a3fcad954d429a9c55564f5f7064@3ds.com> (raw)
In-Reply-To: <87pmq6j1wu.fsf@oldenburg.str.redhat.com>
Hi Florian,
Responding to your idea about filtering...
I just checked the filtering. It does work as expected, means, I cannot build main.c using some new symbol, defined only in filtee.c, but not in filter.c. So the runtime won't use the full set of filtee's symbols, but just a subset, defined in the filter.
You can check my sample, attached to the previous email. Easy to use. Just rename build.txt to build.sh, and put the usual #!/bin/bash on the top to build it. Then run "./prog".
I am completely open to change my wording.
Thanks,
Andrei
-----Original Message-----
From: Florian Weimer <fweimer@redhat.com>
Sent: Wednesday, December 8, 2021 1:08 PM
To: PODOPLELOV Andrei <Andrei.PODOPLELOV@3ds.com>
Cc: mtk.manpages@gmail.com; linux-man@vger.kernel.org; alx.manpages@gmail.com
Subject: Re: [patch] --filter option in ld: srcfix
* PODOPLELOV Andrei:
> I believe it would be beneficial to change it to something like:
>
> --filter=name
> When creating an ELF shared object (a "filter"), set the
> internal DT_FILTER field to the specified name - another
> ELF shared object (a "filtee"). This tells the dynamic linker
> that the symbol table of the "filter" should be used to
> select a subset of the symbols provided by the "filtee".
>
> When you link a program against this "filter" and run it,
> the dynamic linker will see the DT_FILTER field and resolve
> symbols according to the symbol table of the "filter" object
> as usual. However, when a certain symbol of the "filter" is
> also present in "filtee", it will actually link to the
> definition in the "filtee".
I think that's still misleading because to my knowledge, glibc does not implement any filtering. Only the symbol search order is changed (what you describe in the second paragraph).
Thanks,
Florian
This email and any attachments are intended solely for the use of the individual or entity to whom it is addressed and may be confidential and/or privileged.
If you are not one of the named recipients or have received this email in error,
(i) you should not read, disclose, or copy it,
(ii) please notify sender of your receipt by reply email and delete this email and all attachments,
(iii) Dassault Systèmes does not accept or assume any liability or responsibility for any use of or reliance on this email.
Please be informed that your personal data are processed according to our data privacy policy as described on our website. Should you have any questions related to personal data protection, please contact 3DS Data Protection Officer at 3DS.compliance-privacy@3ds.com<mailto:3DS.compliance-privacy@3ds.com>
For other languages, go to https://www.3ds.com/terms/email-disclaimer
next prev parent reply other threads:[~2021-12-09 1:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-08 17:32 [patch] --filter option in ld: srcfix PODOPLELOV Andrei
2021-12-08 20:07 ` Florian Weimer
2021-12-09 1:08 ` PODOPLELOV Andrei [this message]
2021-12-09 15:35 ` Florian Weimer
2021-12-09 16:32 ` PODOPLELOV Andrei
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=11c8a3fcad954d429a9c55564f5f7064@3ds.com \
--to=andrei.podoplelov@3ds.com \
--cc=alx.manpages@gmail.com \
--cc=fweimer@redhat.com \
--cc=linux-man@vger.kernel.org \
--cc=mtk.manpages@gmail.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