mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Szabolcs Nagy <nsz@port70.net>
To: musl@lists.openwall.com
Subject: Re: ldso : dladdr support
Date: Tue, 7 Aug 2012 16:53:23 +0200	[thread overview]
Message-ID: <20120807145322.GH30810@port70.net> (raw)
In-Reply-To: <50212306.6070402@gmail.com>

* musl <b.brezillon.musl@gmail.com> [2012-08-07 16:15:34 +0200]:
> On 07/08/2012 13:46, Szabolcs Nagy wrote:
> > * musl <b.brezillon.musl@gmail.com> [2012-08-07 11:04:19 +0200]:
> >> This patch adds support for dladdr function.
> >> It is based on my previous patch (gnu hash support).
> >>
> > i havent checked the content of your patch yet
> > just had a quick glance
> >
> > i think before you make substantial changes
> > it's better to have some discussion about
> > the design
> Could you tell me more about the design issues
> (I guess this has something to do with function pointers and multi hash algorithms design) ?


i didn't have anything specific in mind about the design
it was a general remark in case you plan to submit
larger contributions

about the function pointers:

using plain if/else might work, but if you use func pointers
then i'd make those part of the dso struct so you dont
need an additional lookup step, so

  dso->hash(s)

instead of

  hashalgo[dso->hashalg].hash(s)


in general keep the number of indirections and layers small
if possible


> >> +	uint32_t shift2 = hashtab[3];
> >> +	uint32_t h2 = h1 >> shift2;
> > i'm not sure if input validation makes sense in ldso
> > but shifts can be tricky (hashtab[3] must be in 0..31 here)
> By validation do you mean mask the shift value with 0x1F ?

i meant that if hashtab[3] comes from outside source
and ldso requires strict validation (i don't know if it does)
then you need to check the range of it somewhere
and return error for bad values



  reply	other threads:[~2012-08-07 14:53 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-07  9:04 musl
2012-08-07 11:46 ` Szabolcs Nagy
2012-08-07 14:15   ` musl
2012-08-07 14:53     ` Szabolcs Nagy [this message]
2012-08-07 23:09     ` Rich Felker
2012-08-08  9:55       ` musl
2012-08-08 11:52         ` Szabolcs Nagy
2012-08-08 12:54           ` Rich Felker
2012-08-08 13:57           ` musl
2012-08-11 23:05             ` Rich Felker
2012-08-15 22:41               ` boris brezillon
2012-08-17  5:39                 ` Rich Felker
2012-08-19 16:42                   ` musl
2012-08-20  2:06                     ` Rich Felker
2012-08-20 12:55                       ` musl
2012-08-20 14:32                         ` musl
2012-08-23 21:39                           ` Rich Felker
2012-08-23 22:21                             ` Rich Felker
2012-08-24  7:29                               ` musl
2012-08-24 18:38                                 ` Rich Felker
2012-08-25  7:42                                   ` boris brezillon
2012-08-25 12:35                                     ` Rich Felker
2012-08-25 22:13                                   ` musl
2012-08-25 22:37                                     ` musl
2012-08-26  0:00                                   ` musl
2012-08-24  8:12                               ` Szabolcs Nagy
2012-08-24  8:56                                 ` musl
2012-08-24  9:38                                   ` Szabolcs Nagy
2012-08-25 21:34                               ` musl
2012-08-25 21:42                                 ` Rich Felker
2012-08-16 18:03               ` musl
2012-08-17 16:35               ` musl
2012-08-08 12:49         ` Rich Felker

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=20120807145322.GH30810@port70.net \
    --to=nsz@port70.net \
    --cc=musl@lists.openwall.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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).