public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: David Kilroy <David.Kilroy@arm.com>,
	"libc-alpha@sourceware.org" <libc-alpha@sourceware.org>
Subject: Re: [PATCH v3 1/3] elf: Allow dlopen of filter object to work [BZ #16272]
Date: Fri, 17 Jan 2020 14:04:00 -0000	[thread overview]
Message-ID: <b18fc5fa-4f7e-c5f1-483a-7fce538eb60e@linaro.org> (raw)
In-Reply-To: <DB6PR0801MB17516D3889996A048AA4349191370@DB6PR0801MB1751.eurprd08.prod.outlook.com>



On 15/01/2020 09:03, David Kilroy wrote:
>> -----Original Message-----
>> From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
>>
>> Since these are the only filter tests, I think we should also add some
>> minimal one to check for invalid filter filter object (which does not
>> provide the required symbol interfaces provided by the filtee).
>>
>> I think also it is worth to extend the tests to cover for auxiliary
>> filters as well (DT_AUXILIARY), since it intersects with DT_FILTERS.
>> It should be similar to DT_FILTER tests, with the only difference
>> that non existent auxiliary filters does not trigger a loader error
>> (if the symbol is provided by the filter or another auxiliary filter).
>>
>> The patch itself looks good, thanks for working on it.
> 
> Thanks for the feedback!
> 
> I'll rebase and take a look at resolving your comments on the 3 commits.
> That may take a couple days :)
> 
> I think all your comments are clear enough, and I should be able to
> deal with. Just on this one...
> 
>>> -  /* Sort the initializer list to take dependencies into account.
>> The binary
>>> -     itself will always be initialize last.  */
>>> -  memcpy (l_initfini, map->l_searchlist.r_list,
>>> -	  nlist * sizeof (struct link_map *));
> ...
> 
>>> +  if (i > 0)
>>> +    {
>>> +      /* Copy the binary into position 0.  */
>>> +      memcpy (l_initfini, &map->l_searchlist.r_list[i],
>>> +	      sizeof (struct link_map *));
>>> +      /* Copy the filtees.  */
>>> +      memcpy (&l_initfini[1], map->l_searchlist.r_list,
>>> +	      i * sizeof (struct link_map *));
>>> +      /* Copy the remainder.  */
>>> +      memcpy (&l_initfini[i + 1], &map->l_searchlist.r_list[i + 1],
>>> +	      (nlist - i - 1) * sizeof (struct link_map *));
>>
>> Ok (although I not sure if is the correct idiom to use memcpy to
>> copy array of pointers
>>
>>
>>> +    }
>>> +  else
>>> +    memcpy (l_initfini, map->l_searchlist.r_list,
>>> +	    nlist * sizeof (struct link_map *));
>>> +
> 
> The original code was using a memcpy (presumably for speed), so I tried to
> stick with that. I'm happy to change the new branch to use a loop to copy the
> pointers - should I leave the original copy as a memcpy?

I don't have a strong preference, I think we can use the memcpy
code.

  reply	other threads:[~2020-01-17 13:35 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-03 17:30 [PATCH v3 0/3] " David Kilroy
2019-12-03 17:30 ` [PATCH v3 1/3] " David Kilroy
2020-01-14 18:31   ` Adhemerval Zanella
2020-01-15 12:37     ` David Kilroy
2020-01-17 14:04       ` Adhemerval Zanella [this message]
2020-01-17 17:00     ` David Kilroy
2020-01-21 16:34       ` David Kilroy
2020-01-22 20:39         ` Adhemerval Zanella
2019-12-03 17:30 ` [PATCH v3 2/3] elf: avoid redundant sort in dlopen David Kilroy
2020-01-14 19:42   ` Adhemerval Zanella
2019-12-03 17:30 ` [PATCH v3 3/3] elf: avoid stack allocation in dl_open_worker David Kilroy
2020-01-14 20:04   ` Adhemerval Zanella
2019-12-18 16:32 ` [PATCH v3 0/3] elf: Allow dlopen of filter object to work [BZ #16272] David Kilroy
2019-12-18 19:33   ` Adhemerval Zanella
2019-12-19 11:43     ` David Kilroy

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=b18fc5fa-4f7e-c5f1-483a-7fce538eb60e@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=David.Kilroy@arm.com \
    --cc=libc-alpha@sourceware.org \
    /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).