public inbox for gnu-gabi@sourceware.org
 help / color / mirror / Atom feed
From: Suprateeka R Hegde <hegdesmailbox@gmail.com>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: Carlos O'Donell <carlos@redhat.com>, gnu-gabi@sourceware.org
Subject: Re: RFC: ABI support for special memory area
Date: Sun, 01 Jan 2017 00:00:00 -0000	[thread overview]
Message-ID: <96294553-8088-0a9a-3957-1006743619d5@gmail.com> (raw)
In-Reply-To: <CAMe9rOoMU9z_2RLD7-V=j7sB75aH29YsVrNPDpGUNuuDonC5kA@mail.gmail.com>

On 03/27/17 21:45, H.J. Lu wrote:
> 
> There is a way to support GNU_MBIND segments without the glibc changes.
> Instead, dl_iterate_phdr
> 
> int dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info,
>                                       size_t size, void *data),
>                      void *data);
> 
> is called via the .init_array section to process GNU_MBIND segments in
> executable and shared objects:
> 
> static int
> callback (struct dl_phdr_info *info, size_t size, void *data)
> {
>   Compute the load address of the current module.
>   if info->dlpi_addr == the load address of the current module
>     {
>       check ELF program headers and process GNU_MBIND segments
>       return 1;
>     }
> 
>   return 0;
> }
> 
> static void
> call_gnu_mbind_setup (void)
> {
>   dl_iterate_phdr (callback, NULL);
> }
> 
> static void (*init_array) (void)
>  __attribute__ ((section (".init_array"), used))
>  = &call_gnu_mbind_setup;

This looks very ideal and perfect and matches my requirement too. Are
you suggesting this dl_iterate_phdr(3) as the way in your proposal
instead of the __gnu_mbind_setup?

Or are you suggesting that for all the implementations  that need
different arguments (like that of my NVM) compared to
__gnu_mbind_setup_v1, we go with this dl_iterate_phdr(3) way?

I am OK either way.

However, I am just thinking that your earlier approach --
__gnu_mbind_setup -- is better when shared libraries with GNU_MBIND
segments are dlopen'ed. They dont have to iterate all over again to
reach their PHDR. Or what is the recommendation for such dlopen'ed
libraries?

And this dl_iterate_phdr(3) not being part of any standards, may change
in a totally incompatible way in the future.

--
Supra

  reply	other threads:[~2017-03-30 16:02 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-01  0:00 H.J. Lu
2017-01-01  0:00 ` Carlos O'Donell
2017-01-01  0:00   ` H.J. Lu
2017-01-01  0:00     ` Carlos O'Donell
2017-01-01  0:00       ` H.J. Lu
2017-01-01  0:00         ` Florian Weimer
2017-01-01  0:00           ` H.J. Lu
2017-01-01  0:00 ` Suprateeka R Hegde
2017-01-01  0:00   ` H.J. Lu
2017-01-01  0:00     ` Suprateeka R Hegde
2017-01-01  0:00       ` H.J. Lu
2017-01-01  0:00         ` Carlos O'Donell
2017-01-01  0:00           ` Suprateeka R Hegde
2017-01-01  0:00             ` H.J. Lu
2017-01-01  0:00               ` Suprateeka R Hegde
2017-01-01  0:00                 ` H.J. Lu
2017-01-01  0:00                   ` H.J. Lu
2017-01-01  0:00                     ` Florian Weimer
2017-01-01  0:00                       ` H.J. Lu
2017-01-01  0:00                         ` Florian Weimer
2017-01-01  0:00                           ` H.J. Lu
2017-01-01  0:00                             ` Florian Weimer
2017-01-01  0:00                               ` H.J. Lu
2017-01-01  0:00                     ` Suprateeka R Hegde
2017-01-01  0:00                       ` H.J. Lu
2017-01-01  0:00                         ` Suprateeka R Hegde
2017-01-01  0:00                           ` H.J. Lu
2017-01-01  0:00                             ` Suprateeka R Hegde
2017-01-01  0:00                               ` H.J. Lu
2017-01-01  0:00                                 ` Suprateeka R Hegde [this message]
2017-01-01  0:00                                   ` H.J. Lu
2017-01-01  0:00                                     ` Suprateeka R Hegde
2017-01-01  0:00                                       ` H.J. Lu

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=96294553-8088-0a9a-3957-1006743619d5@gmail.com \
    --to=hegdesmailbox@gmail.com \
    --cc=carlos@redhat.com \
    --cc=gnu-gabi@sourceware.org \
    --cc=hjl.tools@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).